Work on multiple branches simultaneously using linked worktrees — use when you need parallel checkouts without stashing or context switching
Check out multiple branches at the same time in separate directories.
git worktree add ../hotfix hotfix-branchcd ../hotfixgit worktree remove ../hotfix# Create worktree for existing branch
git worktree add ../review-dir review-branch
# Create worktree with new branch
git worktree add -b hotfix ../hotfix-dir main
# Detached HEAD worktree (for a tag)
git worktree add --detach ../release-check v2.0
# List all worktrees
git worktree list
# Remove a worktree
git worktree remove ../review-dir
# Force remove (dirty worktree)
git worktree remove --force ../abandoned-dir
# Clean up stale references
git worktree prune
git worktree add -b hotfix/urgent ../hotfix main
cd ../hotfix
# fix, commit, push
cd ../project
git worktree remove ../hotfix
git fetch origin
git worktree add ../review origin/pr-branch
cd ../review && npm test
cd ../project
git worktree remove ../review
../name conventiongit worktree prune cleans up deleted dirs../hotfix-login not ../tmp