git worktrees · crystl blog

git worktrees

The mechanics of git worktrees, and why they became load-bearing for agent work.

Jul 31, 2026 Git: Cannot Delete Branch Used by a Worktree \
Git refuses to delete a branch a worktree has checked out, even with -D. Find the worktree with git worktree list, remove it, then delete the branch clean.

Jul 31, 2026 git worktree add: Every Form of the Command \
git worktree add with a new branch, an existing branch, a remote branch, a commit, or a detached HEAD. Every flag that matters, with examples and errors.

Jul 31, 2026 Git Worktree vs Branch (vs Multiple Clones) \
A branch moves one working copy. A worktree adds a second, on the same history. A clone is a separate repo entirely. The commands, and when to use each.

Jul 31, 2026 A Git Worktree Workflow That Stays Tidy \
Where to put worktrees, how to name them, what to do about node_modules and .env, and when to remove them. The habits that keep worktrees from sprawling.

Jul 31, 2026 Git Worktrees in Cursor, Zed, and IntelliJ \
Yes. IntelliJ's Worktrees tab in the Git tool window handles them natively. Where to find it, plus how Cursor and Zed handle worktrees instead.

Jul 31, 2026 How to Remove a Git Worktree \
git worktree remove deletes a directory and its metadata in one step. git worktree prune cleans up what you deleted by hand. Neither touches the branch.

Jun 19, 2026 How to Use Git Worktrees with Claude Code \
Claude Code worktree commands explained: the --worktree flag, what it does, real parallel-agent workflows, the gotchas, and how to automate it.

Mar 17, 2026 Why Your Claude Code Agents Keep Overwriting Each Other's Files \
Running multiple Claude Code agents on the same repo? Why they conflict and how to fix it with isolated worktrees.

Mar 14, 2026 How to Run Two Claude Code Agents on the Same Repo Without Destroying Your Git History \
Multitasking with two Claude Code agents on the same branch causes merge conflicts. The fix is git worktrees, and you can automate it.