Examples (7)
Add a new worktree directory for a branch with the same name (created if missing)
git worktree add branchCreate a new directory with the specified branch checked out into it
git worktree add path/to/directory branchCreate a new directory with a new branch checked out into it
git worktree add path/to/directory -b new_branchList all the working directories (including the primary one)
git worktree listMove an existing worktree to a new location
git worktree move path/to/worktree new/pathRemove a worktree directory and its metadata (only if it has no uncommitted changes)
git worktree remove path/to/worktreeRemove metadata for a worktree directory that's been manually deleted
git worktree prunemade by @shridhargupta | data from tldr-pages