Loading topic
main branch. It covers the four git worktree subcommands you will use most: add, list, remove and prune. It also covers lock, which protects a worktree from pruning.3 min readgit worktree add once. It covers the rule that limits which branches a worktree can use, and the detached HEAD option that works around it.2 min readgit worktree add, that each task already has its own branch, and that you have run a command-line coding agent on a single task. Here you start several agents at once, one per worktree, and wait for them to finish.3 min readgit worktree add and know that each worktree has its own branch and working files. Worktrees isolate files in the working tree. They do not isolate anything else on the machine, and parallel agents can still interfere with each other through that3 min readdiff, log, and merge. Each agent has finished its task on its own agent/ branch. Your job now is to decide what goes into main.3 min readgit diff main...agent/auth.3 min readgit worktree add, and that you know how to merge branches and check git status. Once an agent's branch is merged, its worktree and branch are clutter. Cleaning up in the right order keeps you from losing work that has not been merged.3 min readgit worktree add, remove and prune, the one-branch-per-worktree rule, and how to start an agent in a background subshell. Here you combine those commands into one script, so the whole lifecycle is repeatable.2 min read