Skip to content
Download

Branches and tags

Your branches, remotes and tags are in the Repository view, on the left.

Your branches

Branches lists your local branches, in folders for names such as feature/login.

  • The branch you're on is in bold, with a tick.
  • ↑ and ↓ beside a branch count its commits to push and to pull.
  • Choose a branch to show its newest commit in History.

The Repository view with Branches, Remotes and Tags open: main ahead by two, origin, and the tags v0.2.0 and v0.1.0The Repository view with Branches, Remotes and Tags open: main ahead by two, origin, and the tags v0.2.0 and v0.1.0

Make a branch

  • New branch (+), on the Branches heading, or Branch on History's toolbar, asks for a name, makes the branch at the commit you're on, and switches to it.
  • Branch here, in a commit's details, makes a branch at that commit without switching to it.
    See History.

A new branch has no upstream until you push it; see Fetch, pull and push.
If Git doesn't take the name, Commitline says so before anything changes.

Switch

Double-click a branch, or right-click it and choose Switch to branch.

Your uncommitted changes come along when Git can carry them.
When a change is in the way, Git doesn't switch, and Commitline names the files: commit or stash them first.
Commitline doesn't switch during a merge, rebase, cherry-pick or revert, or to a branch another worktree has out.

To work on a branch that's only on the remote, such as a colleague's, choose Switch to branch on its pull request under Pull requests, or run git switch with its name in a terminal.

Rename and delete

Right-click a branch:

  • Rename… lets you type the new name in place; Enter renames it, and Escape keeps the old one.
  • Delete deletes it, if it's merged.
    Git refuses a branch whose commits aren't merged anywhere, so you lose no work.
    You can't delete the branch you're on.

Ctrl+Z (⌘Z on a Mac) brings a deleted branch back at its commit, but not its upstream or other settings.
See Undo.

Remotes

Remotes lists each remote with its branches.
Each remote branch shows how many commits it has that your branch doesn't, and how many your branch has that it doesn't.
Choose one to show its newest commit in History.

To add, change or remove a remote, use git remote in a terminal.

Tags

Tag, in a commit's details, makes a tag at that commit; type its name and choose Create.

  • Tags, in the Repository view, lists them.
    Choose one to show its commit in History.
  • Right-click a tag and choose Delete to delete it.

Commitline makes lightweight tags, with no message.
A push sends no tags: to publish one, run git push origin and the tag's name in a terminal.