GitHub Desktop and Git Worktree
GitHub Desktop is one of the most popular graphical Git clients, but its support for git worktree is limited. This page covers the current state of worktree support in GitHub Desktop, practical workarounds you can use today, and alternative tools that offer better worktree integration.
Does GitHub Desktop Support Worktrees?
As of now, GitHub Desktop does not have native worktree support. There is no built-in UI for creating, listing, or managing worktrees. If you open a linked worktree directory in GitHub Desktop, it may behave unpredictably or fail to recognize the repository structure correctly.
The core limitation is that GitHub Desktop expects a traditional .git directory at the root of each repository. In a linked worktree, the .git entry is a file (not a directory) that points back to the main repository's git directory. While git itself handles this transparently, GitHub Desktop's internal repository detection does not fully account for this pattern.
This has been a community-requested feature for several years. The GitHub Desktop team has acknowledged the request, but there is no confirmed timeline for when native worktree support might be added.
Workarounds for Using Worktrees with GitHub Desktop
While GitHub Desktop cannot manage worktrees directly, you can use a combination of the terminal and GitHub Desktop to get a workable workflow.
Step 1: Create Worktrees from the Terminal
Use the command line to create and manage your worktrees. This is the standard git worktree add workflow:
# Navigate to your main repository
cd ~/Projects/my-repo
# Create a worktree for a feature branch
git worktree add ../my-repo-feature feat/new-feature
# Create a worktree for a hotfix
git worktree add ../my-repo-hotfix hotfix/critical-bugStep 2: Add Each Worktree as a Separate Repository
In GitHub Desktop, use File > Add Local Repository and point it to the worktree directory. GitHub Desktop will treat it as a separate repository. You can then view changes, stage files, and commit from the GUI. This workaround has some caveats:
- GitHub Desktop may show warnings about the repository structure. These are generally safe to ignore.
- Branch switching within GitHub Desktop should be avoided for linked worktrees, as each worktree is tied to a specific branch. Use the terminal for any branch management.
- Some operations like fetching and pulling work normally since they operate on the shared git objects.
# After adding the worktree directory in GitHub Desktop,
# you can still manage worktrees from the terminal:
# List all worktrees
git worktree list
# Remove a worktree when done
git worktree remove ../my-repo-featureViewing Diffs and Staging Changes
Once a worktree is added as a repository in GitHub Desktop, you can use its diff viewer and commit interface normally. The staged/unstaged file views, line-by-line staging, and commit history all work as expected. This gives you the visual diff experience of GitHub Desktop combined with the branch isolation of git worktrees.
Alternative Tools with Better Worktree Support
If you rely heavily on worktrees, consider using a Git client that offers native support:
Command Line
The git CLI has complete worktree support and is the most reliable way to create, list, and manage worktrees. You can pair it with terminal-based tools like lazygit or tig for a visual interface without leaving the terminal.
VS Code with GitLens
VS Code handles worktrees natively. Open any worktree directory and VS Code recognizes it as a git repository. The GitLens extension adds explicit worktree management with a dedicated panel for creating and switching between worktrees.
GitKraken
GitKraken offers worktree support through its interface, letting you create and manage worktrees visually. It correctly handles the linked worktree .git file format and displays worktree information in its repository view.
SourceTree
SourceTree has partial worktree support. While it does not provide a dedicated worktree management UI, you can add worktree directories as separate bookmarks. See our SourceTree worktree guide for details.
Feature Request Status
The request for git worktree support in GitHub Desktop has been tracked in the GitHub Desktop repository on GitHub. The issue has received significant community engagement with upvotes and comments from users who want this feature. Key points from the discussion:
- The feature request asks for the ability to create, switch between, and remove worktrees from within GitHub Desktop.
- Some contributors have pointed out that worktree support would require changes to how GitHub Desktop detects and opens repositories.
- The GitHub Desktop team has not committed to a specific release for this feature, but it remains an open request.
If worktree support in GitHub Desktop is important to you, upvoting the feature request on GitHub helps signal demand. In the meantime, the terminal-based workaround described above provides a functional, if imperfect, solution.
While GitHub Desktop lacks native git worktree support, you can still use worktrees by creating them from the terminal and adding each worktree directory as a separate repository in GitHub Desktop. For a fully integrated experience, consider the command line or an editor with built-in worktree support. Return to the IDE integration overview to explore other tools.