Analytics
Skip to content

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 ​

  1. Go to Repository > Worktrees
  2. Click Add Worktree
  3. Choose a branch or create a new one
  4. Select the folder location
  5. 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 ​

  1. Right-click the worktree
  2. Select Remove
  3. 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 ​

  1. Keep worktrees organized - Use a consistent folder structure
  2. Clean up when done - Remove worktrees you no longer need
  3. Don't checkout same branch - Each branch can only be checked out in one worktree

Released under the MIT License.