git-worktree
Manage multiple working trees for a repository
TLDR
Add worktree
$ git worktree add [../feature-branch] [branch-name]
List worktrees$ git worktree list
Remove worktree$ git worktree remove [path]
Prune stale worktrees$ git worktree prune
Add worktree for new branch$ git worktree add -b [new-branch] [path]
SYNOPSIS
git worktree command [options]
DESCRIPTION
git worktree manages multiple working trees attached to one repository. Each worktree can have a different branch checked out, enabling parallel work without stashing or switching branches.
Worktrees share the same repository data but have separate working directories. This is useful for working on a bug fix while a feature branch is mid-development, or for running tests on one branch while editing another.
PARAMETERS
add PATH BRANCH
Add new worktree.list
List worktrees.remove PATH
Remove worktree.prune
Remove stale worktrees.-b BRANCH
Create new branch.--help
Display help information.
CAVEATS
Same branch can't be checked out twice. Worktrees share reflog. Removing worktree doesn't delete branch.
HISTORY
git worktree was added in Git 2.5 to enable multiple working directories from a single repository clone.
SEE ALSO
git-checkout(1), git-branch(1)
