Git Worktrees
Properties
created
15.03.2026, 00:00
modified
Empty
published
Empty
sources
Git Worktrees
topics
Git, Worktrees
authors
Empty
ai-assisted
Yes
A git worktree allows you to check out multiple branches simultaneously into separate directories, all sharing the same
.gitrepository. This enables parallel work without stashing or switching branches.
# Use Cases
- Work on a hotfix while keeping your feature branch untouched
- Run tests on one branch while developing on another
- Review a PR in an isolated directory without context-switching
# Commands
# Create
| |
# List & Inspect
| |
# Remove
| |
# Move & Lock
| |
# Notes
- Each worktree has its own working directory and index but shares refs, objects, and config
- A branch can only be checked out in one worktree at a time
.git/worktrees/stores per-worktree metadata