Switching Branches
For existing branches:
git switch <branch-name>To create new branches:
git switch -c <new-branch-name>Read more about git switch vs. git checkout.
Manual reference: git switch.
Working with Worktrees
List all attached worktrees:
git worktree listCreate a new worktree for a branch (creates the branch if needed):
git worktree add -b <new-branch-name> ../<folder-name>Create a worktree for an existing branch:
git worktree add ../<folder-name> <branch-name>Remove a worktree when done:
git worktree remove ../<folder-name>Clean up stale worktree metadata:
git worktree pruneManual reference: git worktree.