Skip to main content

This version of GitHub Enterprise Server will be discontinued on 2026-09-22. Discontinued releases are not supported. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features in GitHub Enterprise Server, see Overview of the upgrade process. For help with the upgrade, GitHub Enterprise Support.

Managing worktrees in GitHub Desktop

Worktrees let you work on multiple branches of the same repository at the same time, so you can switch contexts, review changes, or make hotfixes without stashing your work.

Platform navigation

About worktrees

Git worktrees let you check out multiple branches of the same repository at the same time, each in its own directory on your computer. This means you can work on a feature branch, quickly review a pull request on a different branch, or make a hotfix without stashing or committing incomplete work on your current branch.

GitHub Desktop provides built-in support for creating, switching between, renaming, and deleting worktrees. When your repository has worktrees, a Worktree dropdown appears in the toolbar between the Repository and Branch dropdowns.

Note

The Worktree dropdown is only visible when you have at least one linked worktree. To create your first worktree, use the Repository menu or right-click the Repository dropdown in the toolbar.

Each worktree is associated with a branch (or a detached HEAD commit). The main worktree is your original repository clone, and linked worktrees are additional checkouts you create.

Creating a worktree

You can create a new worktree from the Repository menu, by right-clicking the Repository dropdown in the toolbar, or (once you already have worktrees) from the Worktree dropdown.

Creating your first worktree

If your repository does not have any linked worktrees yet, the Worktree dropdown is not visible in the toolbar. To create your first worktree:

  1. In the menu bar, click Repository, then click New Worktree….

    Alternatively, right-click the Repository dropdown in the toolbar and click New Worktree….

    Screenshot of the "Repository" dropdown menu on a Mac. The "New Worktree" option is highlighted in blue.

    Screenshot of the "Repository" dropdown menu on Windows. The "New worktree" option is highlighted in blue.

  2. In the "Add worktree" dialog, type a name for your worktree in the Worktree name field.

    GitHub Desktop automatically determines the path where the worktree will be created, based on the name you enter. The full path is displayed at the bottom of the dialog.

  3. Optionally, in the Branch name field, type or select a branch name.