book-git-commands/src/branching/worktree.md

13 lines
275 B
Markdown
Raw Normal View History

2023-04-01 19:48:24 +00:00
# Worktree
```bash
# List all worktrees for the current repo.
git worktree list
# Create a new worktree for a specific branch. Path can't be a current working directory.
git worktree add ../path/for/branchName
# Delete a worktree.
git worktree remove path/to/worktree
```