Skip to main content

One post tagged with "advanced-git"

View All Tags

Git Worktree Trick: Merge Without Checkout! πŸͺ„

Β· 12 min read
Mahmut Salman
Software Developer

The Problem πŸ˜•β€‹

Backend Dev: "I want to merge my frontend branch into main, but when I try git checkout main, Git says 'fatal: main is already checked out at ../EcommerceWebsite3-backend'. I can't checkout main because it's being used in my backend worktree!"

Frontend Mentor: "Ah! This is a perfect situation to use one of Git's hidden superpowers - pushing to a local branch without checking it out!"