Branch Compare

Branch Compare is a dedicated view for answering "what is different between this branch and the one I'm on right now?". It overlays both histories on a two-lane graph, shows the merge base where they split, lists every file that differs, and lets you drill into a specific commit's changes without leaving the view.

Opening the Compare View

Branch Compare is opened from the Branches section: pick any non-HEAD branch (local or remote), open its context menu, and choose Compare with current. The compare view takes over the right side of the Git panel and stays up until you close it with the X button in its header.

The currently checked-out branch plays the role of the base, and the branch you picked from the context menu plays the role of the compare side. The rest of the Git panel — toolbar, section navigation — stays available while Compare is open.

The Compare Header

The top of the view identifies the two branches and summarises their differences:

  • Title row: a Compare label followed by the two branch names. The currently checked-out branch is shown next to an orange dot on the left, and the branch you are comparing against is shown next to a green dot on the right. A close button (X) on the far right closes the compare view and returns you to the plain Branches list.
  • Stats row: below the title, a small strip showing N ahead (green dot), M behind (orange dot), and the total number of files changed between the two branches. Zero counts are simply omitted — if the compare branch is only ahead, the behind entry is hidden.
  • Show all changes link: appears in the stats row only when you have drilled into a specific commit. Clicking it discards the per-commit drill-down and returns to the full cross-branch diff.

When the two branches happen to be identical, the entire body area is replaced by a centered message — "Branches are identical" — so you do not stare at an empty view waiting for something to appear.

The Two-Lane Compare Graph

The left 280 pixels of the compare body are a vertical graph that shows both histories on the same timeline. Its goal is to make divergence obvious at a glance, the way a classic "network graph" on a Git host would.

  • Two lanes: an orange lane on the left representing the base branch (the one you are on), and a green lane on the right representing the compare branch. Only lanes that actually have commits are drawn, so if one side has nothing to show, its column is omitted.
  • Branch labels: a small header above the graph shows the orange dot + base branch name and the green dot + compare branch name, keeping the colour mapping visible even if you scroll the graph.
  • Commit rows: every ahead or behind commit gets its own row. Rows are sorted by timestamp, newest first, so the most recent change sits at the top regardless of which side it belongs to.
  • Merge base diamond: at the very bottom of the graph, the two lanes join at a blue diamond marker labelled "merge base" with the short hash of the shared ancestor. That is the point where the two branches last agreed.
  • Row content: each row shows the commit subject on top and, underneath, the short hash, author name, and a relative time (2h ago, 3d ago, etc.).
  • Selection state: clicking a row selects that commit, and the selected row gets an accent edge plus a ring around its dot so it is unambiguous which commit is active. Clicking a different row switches to it; clicking Show all changes in the stats bar clears the selection.

The Files and Diff Pane

Everything to the right of the compare graph is dedicated to file inspection and is split vertically into a file list on top and a diff viewer below:

  • File list (top, up to 30% of the height): a scrollable list of files.
  • Diff viewer (bottom, remaining space): the same side-by-side / unified diff viewer used everywhere else in the panel, with the same binary-file handling and view-mode toggle. It shows the diff of whichever file is selected in the list above.

The list of files depends on whether a specific commit is selected in the graph:

  • No commit selected (default): the list shows every file that differs between the two branches — the full cross-branch diff. The header's files-changed counter matches this list.
  • A commit selected: the list switches to the files touched by that specific commit only. Use this to pinpoint exactly which commit introduced a change before deciding what to do about it.

Whenever the displayed file list changes — because you selected a commit, deselected it via Show all changes, or opened the view for the first time — the first file in the new list is selected automatically so the diff viewer is never empty. If a branch has commits but no file changes (unusual, but possible), the right pane shows "No file changes"instead of the diff viewer.

Typical Ways to Use Compare

  • Pre-merge review: before picking Merge into current from the branch context menu, open Compare on the target branch, scroll through the file list, and read the diffs. You see exactly what the merge would bring in.
  • Blame substitute: when you know "a threshold changed between these two branches" but not which commit did it, click through the commits in the graph one at a time until you find the one whose per-commit file list contains the file you care about.
  • Divergence check: when the stats bar reports N ahead, M behind, the graph shows whether the two sides worked on the same area of the repository (rows stacked over each other) or on unrelated areas (rows clearly separated) — useful for predicting merge conflicts before they happen.