Branches and tags

Branches are managed from the branch list in the History tab, tags from the Tags tab.

Branch context menu

Right-click a branch in the branch list. The menu depends on whether the branch is the current branch.

For the current branch:

ItemAction
PushPushes the branch.
Force push (with lease)…Opens the force-push dialog. See Commit and sync.
Pull (fast-forward)Pulls without creating a merge commit. Fails if the branches have diverged.
Pull (rebase)Pulls and rebases your local commits onto the remote branch.
FetchFetches from the remote.
Open pull request…Opens the pull request dialog for this branch.
New branch from here…Creates a branch at this branch's tip.
Tag from branch tip…Opens the tag dialog for the tip commit.
Merge from… (pick branch)Merges another branch into this one.
Rebase onto… (pick branch)Rebases this branch onto another branch.
RenameAsks for the new name and renames the branch.

The current branch cannot be deleted.

For any other branch:

ItemAction
Checkout "name"Switches to the branch.
Open pull request from "name"…Opens the pull request dialog for this branch.
New branch from "name"…Creates a branch at this branch's tip.
Tag from "name" tip…Opens the tag dialog for the tip commit.
Merge "name" into "current"Merges this branch into the current branch.
Rebase "current" onto "name"Rebases the current branch onto this branch.
Rename, DeleteLocal branches only.

Create a branch

  1. Right-click the branch to start from and choose New branch from here… (current branch) or New branch from "name"… (other branch).
  2. Enter the name, for example feature/my-change.
  3. To switch to the new branch right away, keep Check out immediately selected.
  4. Click Create.

Merge or rebase

  1. Right-click the current branch.
  2. Choose Merge from… (pick branch) or Rebase onto… (pick branch).
  3. Select the other branch in the dialog.

Alternatively, right-click the other branch and choose Merge "name" into "current" or Rebase "current" onto "name".

If a merge stops on conflicts, the Git view switches to the merge editor. See Resolve merge conflicts.

Tags

The Tags tab lists the tags of the repository. Filter… narrows the list. Each tag has these actions:

ActionEffect
PushPushes the tag to the remote.
+ ReleaseShown when no release exists for the tag. Asks for a title, then for optional release notes, and creates a GitHub release.
Delete releaseShown when a release exists for the tag. Deletes the GitHub release.
Delete localDeletes the tag in the local repository.
Delete remoteDeletes the tag on the remote.

The release actions need the GitHub CLI gh, signed in for the repository. A tag with a release shows a release label that opens the release in the browser. Every delete asks for confirmation.

Push all tags (--tags) pushes every local tag.

Create a tag

  1. Open the tag dialog in one of these ways:

    • In the history, right-click a commit and choose Tag this commit….
    • In the branch list, right-click a branch and choose Tag from branch tip….
  2. Enter the Name, for example v1.2.3.

  3. Optional settings:

    OptionEffect
    Annotated tag (with message)Creates an annotated tag. Enter the Message.
    Force (overwrite existing tag)Replaces a tag with the same name.
    Push tag to originPushes the tag after creating it.
    Also create releaseCreates a release on the remote. Enter Notes and choose Draft or Pre-release if needed.
  4. Confirm the dialog.