Git Worktree in SourceTree
SourceTree by Atlassian is a popular free Git GUI for macOS and Windows. While it does not have a dedicated worktree management interface, you can use git worktree effectively with SourceTree by combining its built-in terminal with its bookmark and tab features. This guide walks through the setup and daily workflow.
SourceTree Worktree Support Status
SourceTree does not have a built-in GUI for creating or managing git worktrees. There are no menu items, toolbar buttons, or context menu options specifically for worktree operations. However, SourceTree does work with linked worktree directories: you can open a worktree folder as a repository, and SourceTree will correctly display the branch, commit history, file status, and diffs.
The workaround is straightforward: use the terminal (either SourceTree's built-in terminal tab or an external terminal) to run git worktree commands, then add each worktree directory to SourceTree as a separate bookmark. This gives you the visual benefits of SourceTree for staging, diffing, and committing, combined with the branch isolation of worktrees.
Using the Terminal Tab for Worktree Commands
SourceTree includes a built-in terminal that you can open from the toolbar (the Terminalbutton) or via the menu. This terminal opens in the repository's root directory, making it convenient to run worktree commands without switching applications.
# In SourceTree's terminal tab, create a new worktree
git worktree add ../my-project-feature feat/user-profiles
# List all active worktrees
git worktree list
# Remove a worktree when you're done
git worktree remove ../my-project-feature
# Clean up stale worktree references
git worktree pruneThe terminal tab inherits SourceTree's embedded git, so all standard git commands work. After creating a worktree, you can immediately add it to SourceTree as a bookmark (covered in the next section).
Adding Worktrees as Separate Bookmarks
Once you have created a worktree, add it to SourceTree so you can access it from the GUI. Each worktree appears as its own repository entry in SourceTree's bookmark browser:
- Open the SourceTree bookmark browser (the tab view or File > New/Open).
- Click Add Existing Local Repository (or drag the worktree folder into the bookmark browser).
- Navigate to the worktree directory (e.g.,
../my-project-feature) and select it. - SourceTree adds the worktree as a new bookmark. It shows the correct branch name and commit history.
With this setup, you can have multiple SourceTree tabs open, each pointing to a different worktree. This lets you visually compare changes across branches, stage files with the GUI, and commit from each worktree independently.
# A typical multi-worktree layout in your filesystem:
~/Projects/
my-project/ # Main worktree (main branch) - SourceTree bookmark 1
my-project-feature/ # Linked worktree (feat branch) - SourceTree bookmark 2
my-project-hotfix/ # Linked worktree (hotfix branch) - SourceTree bookmark 3Managing Branches Across Worktrees
When using worktrees with SourceTree, keep in mind that each worktree is locked to a specific branch. You cannot check out a branch that is already checked out in another worktree. SourceTree will show an error if you try to switch to such a branch from the GUI.
To avoid confusion, use the terminal for branch management related to worktrees and use the SourceTree GUI for staging, committing, pushing, and pulling within each worktree:
# Check which branches are in use by worktrees
git worktree list
# /Users/you/Projects/my-project abc1234 [main]
# /Users/you/Projects/my-project-feature def5678 [feat/user-profiles]
# To work on a different branch, create a new worktree
git worktree add ../my-project-experiment experiment/new-api
# After merging a feature, remove the worktree and delete the branch
git worktree remove ../my-project-feature
git branch -d feat/user-profilesSourceTree's branch list will show all branches including those checked out in other worktrees. Branches that are currently checked out in any worktree will be marked, and SourceTree will prevent you from checking them out in the current worktree. For a deeper look at branch operations, see our git worktree list tutorial.
Tips for Using SourceTree with Worktrees
Name Your Bookmarks Clearly
SourceTree uses the directory name as the default bookmark name. If you name your worktree directories descriptively (e.g., my-project-feature instead of just feature), your bookmark list will be easy to navigate at a glance.
Use Custom Actions for Worktree Commands
SourceTree supports custom actions (under Settings > Custom Actions) that let you bind git commands to toolbar buttons or keyboard shortcuts. You can create custom actions for git worktree list, git worktree prune, or other frequently used commands to speed up your workflow.
Remove Bookmarks Before Removing Worktrees
Before running git worktree remove, remove the corresponding bookmark from SourceTree first. Otherwise, SourceTree will show an error when trying to open a bookmark that points to a directory that no longer exists.
Fetch from Any Worktree
Since all worktrees share the same git object store, running fetch or pull in any SourceTree tab updates the shared refs. After fetching in one worktree's tab, switch to another tab and you will see the updated remote branches there too. You only need to fetch once across all your worktrees.
SourceTree and git worktree work together effectively once you know the setup: create worktrees from the terminal, add them as bookmarks, and use SourceTree's GUI for your daily staging and committing workflow. For more worktree guides, see the IDE integration overview or learn the basics with our git worktree add tutorial.