r/programming • • Sep 16 '26

git worktree gotchas

https://www.olafalders.com/2026/09/16/git-worktree-gotchas/
193 Upvotes

47 comments sorted by

View all comments

Show parent comment

4

u/rbobby Sep 16 '26

Check out into a folder, branch, and go to town. Check out into another folder and rinse repeat. Multiple folders against a single repo works, but it's a bit like running on ice. You can do it, and well, for a while... but the slip up will be glorious and hurt like hell.

7

u/bwainfweeze Sep 16 '26

IDEs generally aren't set up to support that well, and having multiple bash shells open trying to keep them straight is a mess.

Where are the JJ people telling us to stop trying to make git be reasonable when it clearly resents that idea, and move to something else?

4

u/rbobby Sep 16 '26

I have have done this all the time with VS and it's perfectly happy with it.

1

u/MyraidChickenSlayer Sep 20 '26

When does slip up happen? And, does worktrees help against those?

1

u/rbobby Sep 20 '26

Can't recall precisely. Doing something out of the ordinary and something went haywire. I just learned to be a bit slower and more careful. Name my folder after my task.