Worktrees
Work on multiple branches simultaneously without switching.
What are Worktrees?
Worktrees let you have multiple working directories linked to a single repository. Each worktree can have a different branch checked out.
Main repo (main branch)
├── .git/
└── src/
Worktree 1 (feature-a branch)
└── src/
Worktree 2 (hotfix branch)
└── src/All worktrees share the same Git history and objects, saving disk space.
Creating a Worktree
- Go to Repository > Worktrees
- Click Add Worktree
- Choose a branch or create a new one
- Select the folder location
- Click Create
Managing Worktrees
List Worktrees
View all worktrees in the Worktrees panel See which branch each worktree has checked out
Open in New Window
Double-click a worktree to open it Or right-click and select Open
Remove Worktree
- Right-click the worktree
- Select Remove
- Choose whether to keep or delete the folder
Prune Stale Worktrees
Clean up references to manually deleted worktrees:
Go to Repository > Worktrees > Prune
Use Cases
- Hotfixes - Work on a fix while keeping feature work intact
- Code Review - Check out a PR branch without losing your work
- Parallel Development - Work on multiple features simultaneously
- Testing - Run tests on one branch while coding on another
- Comparisons - Have two versions side by side
Best Practices
- Keep worktrees organized - Use a consistent folder structure
- Clean up when done - Remove worktrees you no longer need
- Don't checkout same branch - Each branch can only be checked out in one worktree
