What Is git worktree and When Should You Use It?
git worktree lets you check out multiple branches of the same repository into separate directories at the same time, without cloning it again.
Published September 29, 2026
git worktree lets you check out multiple branches of the same repository into separate directories at the same time, without cloning it again.
Key points
- Useful for working on a hotfix in one directory while a feature branch stays checked out, untouched, in another
- All worktrees share the same underlying .git history and object database, saving disk space compared to multiple clones
- git worktree add ../hotfix hotfix-branch creates a new working directory for that branch
Example
git worktree add ../hotfix-dir hotfix-branch