Compare Revisions
You can see how a certain commit changed the repository code base, what files were affected and what was changed in each of them.
On the sidebar, choose Commits to see the revision list.
Scroll down the list to locate the revision you want to check, or find it using the search.
Click the revision entry — all the files affected by this commit will be listed in the right pane:
The list may contain files that were:
Modified
Added
Deleted
Renamed
Now you can see what changes were made in each file. Click the file to display its inline or split (side-by-side) diff and compare its two revisions:
Unified (inline) diff
The unified diff shows you the differences line-by-line:
The deleted fragments are highlighted in red, the added ones are in green, and the modified ones are in blue.
Unchanged blocks of code are hidden. You can reveal them by clicking on the cut lines:
From the unified diff view you can:
Go to a split (side-by-side) diff.
View comments (if any).
Go to the editor and edit this file (if you have a permission):
View the next or previous file in the change set: just scroll the panel up or down.
Hide the diff view:
Split (side-by-side) diff
The split diff view displays different versions of the file — the older one and the newer one — together on one screen. You can inspect the entire content of both versions and compare the differences line-by-line.
The deleted fragments are highlighted in red, the added ones are in green, and the modified ones are in blue.
Merge commit diffs
When comparing versions of a file included in a merge commit, you might notice that the diff is blank. This is perfectly normal for a file that has not been modified in both branches before the merge. Since merging doesn't usually involve intersecting changes or conflicts, the diffs will be empty most of the time.
The diff will display changes only if the merge commit contains a file that is changed relative to both parents (its versions from both branches).
Example:
Let's say there is a branch
Branch A
with a filesomefile.txt
that contains the following lines:Create a branch
Branch B
offBranch A
and change the file (the third line) inBranch B
:In
Branch A
, make some other change to the file (the first line):Merge
Branch B
intoBranch A
.The resulting version of the file will include changes from both branches.
Now you can navigate to the merge commit in Space and open the diff:
We can see the diff because the final version of
somefile.txt
is different from its both parent versions:Branch A
andBranch B
.