Git Reference
Git Reference / Worktrees

15Worktrees

Check out several branches at once in separate folders, sharing one repository. No more stashing to review a PR or ship a hotfix.

git worktree add ../hotfix main            # existing branch
git worktree add -b review ../review origin/pr-42
git worktree list
git worktree remove ../hotfix
git worktree prune