Intermediate
Open
Pro
Choosing Between a Worktree and a Second Branch Checkout
You need to work on two things at once: a feature branch that's most of the way done, and an urgent hotfix for a bug reported in production. You're considering three approaches:
- A:
git stashyour feature work, check outmain, fix the bug, commit, push, thengit stash popto resume the feature. - B:
claude --worktree hotfixin a second terminal while your first terminal keeps working on the feature branch. - C: Finish the feature branch first, then start the hotfix.
- What specifically goes wrong with approach A if the feature branch has uncommitted changes to files the hotfix might also need to touch?
- Explain, mechanistically, why approach B avoids that failure mode.
- Under what circumstance would C actually be the right call despite being the slowest option?
Share this question