Paths Subjects Questions Quizzes Pricing Search
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 stash your feature work, check out main, fix the bug, commit, push, then git stash pop to resume the feature.
  • B: claude --worktree hotfix in a second terminal while your first terminal keeps working on the feature branch.
  • C: Finish the feature branch first, then start the hotfix.
  1. What specifically goes wrong with approach A if the feature branch has uncommitted changes to files the hotfix might also need to touch?
  2. Explain, mechanistically, why approach B avoids that failure mode.
  3. Under what circumstance would C actually be the right call despite being the slowest option?

Share this question

← Back to Git Workflows with Claude Code practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.