Compare branches and tags
Compare References… compares any two branches, tags, remote branches or commits by name. It shows how many commits one is ahead of and behind the other, and the files that differ: either every difference (git diff A B) or only what the new side changed since they split (A...B, what a pull request shows).
Works in GitTree Free: every local Git feature, once you are signed in.
On this page
Before you start
- A repository is open, with the branches or tags you want to compare.
Where to find it
- The command palette: Compare References….
| Action | macOS | Windows and Linux |
|---|---|---|
| The command palette, then Compare References… | ⌘⇧P | Ctrl+Shift+P |
Steps
Pick the two sides
Run Compare References…. Type in Old side and New side: branches, tags, remote branches or a commit id (at least 4 characters) are suggested as you type.
Choose what to compare
The two endpoints shows every difference between the two trees. Changes since the merge base shows only what the new side changed since it split from the old one.
Compare
Press Compare. The bar says, for example, that the new side is 3 ahead of and 1 behind the old side, and the list shows the files that differ.
Expected result
You see how two lines of work relate and exactly which files differ; Change… picks other sides.
Which comparison?
| Choice | Use it to |
|---|---|
| The two endpoints | See what differs between two releases, such as v2.1.0 and v2.2.0. |
| Changes since the merge base | Review a branch before merging it, as a pull request would show it. |
If something goes wrong
“These histories share no commit, so there is no merge base.”
The two sides are unrelated. GitTree shows the two endpoints instead.
“This repository is a shallow clone: the counts may be incomplete.”
Fetch more history for exact numbers (fetch, pull and push).
Questions
Can I compare a branch with my uncommitted work?
Yes: right-click the branch’s commit and choose Compare with Working Directory.