Branches

Create a branch

Click + next to Local branches, or press ⇧⌘N. Type a name (spaces become dashes as you type), pick a prefix such as feature/ if your repository uses them, and choose where it starts. Switch to the new branch is on by default; your uncommitted changes come along. New Branch… in the toolbar (⇧⌘B) opens the same choices in a sheet.

To work on a branch from the server, choose Check Out Remote Branch… (⌥⌘B).

Switch branches

Use the branch menu at the left of the toolbar, or double-click a branch in the sidebar.

The branch menu

Right-click a branch in the sidebar to pull, push or sync it, publish it, merge it into the current branch, rebase onto it, create a branch or tag from it, rename it, archive it or delete it. Items that don't apply are hidden.

Pull requests

For a branch on GitHub, GitLab or Bitbucket, Open Pull Request… (in the branch menu or the Repository menu) opens the host's page to start a pull request (a merge request on GitLab), in your browser. Publish the branch first. With an AI assistant, Draft Pull Request Description… writes the description, and its Open Pull Request button fills it in for you on GitHub and GitLab.

Open in Browser (Repository menu) and Open Commit in Browser (Commit menu) show the repository or a commit on its host.

Branch health

The Branches screen (⌘3) shows what you can clean up: branches already merged, stale ones (no commit for a while), and ones that exist only on this Mac. Merged branches are selected for you.

  1. Check the branches to remove (the current one can't be selected).
  2. Tick Also delete on origin to remove them from the server too.
  3. Choose Delete.

Deleted branches stay recoverable for 30 days in Undo, and archived ones in Branch health.