Compare changes
The compare view shows the difference between two points in a repository. Pick a base ref and a ref to compare against it, and the diff between them appears below. From the same view you can open a merge request that carries the two refs across, so comparing is the usual first step before proposing a change.
Where to find it
- URL:
gitvetrix.com/<owner>/<repo>/compare. You can pre-fill the two refs with?base=<ref>&head=<ref>.
Compare two refs
- Open the compare view for the repository.
- Choose the starting point in the Base selector. Type to filter the list and pick a branch or tag.
- Choose what to compare in the Compare selector the same way.
- Once both refs are set and they differ, the diff between them loads below the selectors.
While no valid pair is selected, the view shows Select base and head branches above to see the diff. When the two refs are identical in content, it shows that there are no differences between them. If the refs cannot be compared, the view explains that both branches must exist and be related.
Open a merge from a comparison
When the base and compare refs are set and differ, an Open merge button appears beside the selectors.
- Set the two refs you want to compare.
- Select Open merge. The new merge request form opens with the compared ref as the source and the base ref as the target, and a suggested title filled in.
Read a diff
The diff surface here is the same one used on a commit's detail page. It opens with a summary of how many files changed and the total lines added and removed, and offers these controls:
- Toggle Unified or Split to read each change as a single column or side by side.
- Toggle Ignore whitespace to drop whitespace-only changes from the diff and the counts.
- Use the Changed files list beside the diff to jump to a file. The list shows how many files you have marked viewed out of the total.
- Within each file, select the file header to collapse or expand its changes, and use the checkbox to mark the file as viewed. Added lines and removed lines are counted per file, and a renamed file notes its old and new paths.
- In a large diff, only the first files load at once. Below them, a control labelled with the batch size — for example, Load 10 more, or Load 10 more (25 remaining) while more than one batch is still hidden — reveals the next set. Select it until every file is loaded.
Related pages
- Commits and the commit graph — read the commit history and open a single commit's diff.
- Branches and tags — list the branches and tags you can compare.