How do I work on two branches of the same repo at once without commits landing on the wrong branch? #27
Answered
by
Kevinchamplin
Kevinchamplin
asked this question in
Q&A
-
|
How do I work on two branches of the same repo at once without commits landing on the wrong branch? |
Beta Was this translation helpful? Give feedback.
Answered by
Kevinchamplin
Jun 13, 2026
Replies: 1 comment
-
|
Two processes sharing one working directory share one HEAD, so one |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kevinchamplin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Two processes sharing one working directory share one HEAD, so one
git checkoutsilently redirects the other's next commit. Give each worker its own working tree:git worktree add ../repo-feature -b feature/x. Each worktree has an independent HEAD and index but shares the object store, so it's cheap and can't cross-contaminate. Clean up withgit worktree remove.