Advanced · Optional lab · about 25 minutes · Brancher Badge
Parallel worktrees and real merges
The job
Nadia has two jobs that change different files: the kitchen wants its list one slot to a printed page, and Sam wants an endpoint that lists the gift boxes. Run them in two sessions at once, review both before either commits, and merge both into main.
After this Lesson you can
- run two Claude Code sessions at once, each in its own Git worktree
- brief each session with only its job
- review both changes before either session commits
- merge both branches into main, settle the conflict and remove the worktrees
What you practise
git push: puts your commits on the remote'smain, where new worktrees startclaude --worktree print-view: Claude Code makes.claude/worktrees/print-view/on the branchworktree-print-view, and the session works thereclaude -w gift-boxes: the short form, for the second sessiongit -C .claude/worktrees/print-view status --short: lists only the changes of the session in that worktreegit merge worktree-print-view: brings a worktree's branch intomaingit merge --no-edit worktree-gift-boxes: merges the second branch without opening an editor for its message; on a conflict it stops for you to settle firstgit worktree remove <path>: removes a worktree you kept, from your main checkout
Intermediate and Advanced open with a free Account.