Branches and Commits
Branches
Branches (Ctrl+2) lists each branch
with its last commit, who made it and when. View →
Columns adds whether the branch is protected and how far it is
ahead of and behind the default branch.
| Key | Action |
|---|---|
Enter |
Show the branch’s commits |
Ctrl+Shift+B |
Compare two branches |
F |
Add the branch to favorites, or remove it |
Comparing branches
Actions → Compare Branches…
(Ctrl+Shift+B, in the Branches view) asks two questions,
one after the other. “Step 1 of 2” asks for the base
branch, the one to compare from, usually main. “Step 2 of
2” asks for the head branch to compare against it, and
starts on the branch you were on in the list.
The result opens in a text window you can read line by line: how many
commits the head branch is ahead and behind, the commits it adds, and
the files changed with their additions and deletions. The status bar
gives the short version, for example “‘feature’ is 3 ahead, 0 behind
‘main’.” Press Escape or OK to close
it.
Commits
Commits (Ctrl+3) lists the commits on
the default branch. Enter on a branch in the Branches view
lists that branch’s commits instead, and Backspace takes
you back to the branches.
To switch branch without going back, use Actions → Select
Branch… (Ctrl+B), which works in the Commits view
and starts on the branch you are viewing.
Each commit shows its short SHA, message, author and date;
View → Columns adds how many files changed and the
lines added and removed. The details panel has the full SHA, the branch,
the whole message, and the files changed when GitHub reports them.
Enter on a commit opens it on GitHub.