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:
| Item | Action |
|---|---|
| Push | Pushes 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. |
| Fetch | Fetches 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. |
| Rename | Asks for the new name and renames the branch. |
The current branch cannot be deleted.
For any other branch:
| Item | Action |
|---|---|
| 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, Delete | Local branches only. |
Create a branch
- Right-click the branch to start from and choose New branch from here… (current branch) or New branch from "name"… (other branch).
- Enter the name, for example
feature/my-change. - To switch to the new branch right away, keep Check out immediately selected.
- Click Create.
Merge or rebase
- Right-click the current branch.
- Choose Merge from… (pick branch) or Rebase onto… (pick branch).
- 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:
| Action | Effect |
|---|---|
| Push | Pushes the tag to the remote. |
| + Release | Shown when no release exists for the tag. Asks for a title, then for optional release notes, and creates a GitHub release. |
| Delete release | Shown when a release exists for the tag. Deletes the GitHub release. |
| Delete local | Deletes the tag in the local repository. |
| Delete remote | Deletes 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
-
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….
-
Enter the Name, for example
v1.2.3. -
Optional settings:
Option Effect 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 origin Pushes the tag after creating it. Also create release Creates a release on the remote. Enter Notes and choose Draft or Pre-release if needed. -
Confirm the dialog.