3 ms·
I use git worktrees daily. I'm surprised by how hard it can be to explain them to people who have never used them. Lately I've settled on "like clones, but shar
by irskep 1mo ago
I use git worktrees daily. I'm surprised by how hard it can be to explain them to people who have never used them. Lately I've settled on "like clones, but sharing a .git directory." The article tries to get this across by comparing them to branches, but I think clones are a more intuitive concept to compare against.
To solve some of the ergonomics issues (command verbosity, manual commands to copy over .env files and install dependencies), I wrote autowt, which is a lightweight but powerful worktree manager: https://steveasleep.com/autowt/ https://steveasleep.com/autowt/
Once I dialed in the cli experience, I basically stopped typing 'git checkout <branch>' to change tasks, because it's easier to ignore working directory state when flipping between tasks.
- rhyperior 1mo agoI just ran into a situation where I had two Claude instances working in the same repo on two different, independent issues. I noticed the sessions were thrashing a bit on which branch they were on because each was taking control from the other session. That’s when it hit me why I need worktrees.
- anon7000 1mo agoAnd depending how much you let Claude do, you can trivially say “in a new worktree, $prompt” and it’ll happily set it up and use it