JetBrains SpaceCode Preview Help

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.

Navigate to the repository you are interested in and open the Commits tab:

  1. Scroll down the list to locate the commit you want to check, or find it using the search.

  2. Click on the commit to pen it. All the files affected by this commit will be listed in the left pane:

    commitsViewFiles.png

    The list may contain files that were:

    • file-modified.png Modified

    • file-added.png Added

    • file-deleted.png Deleted

    • file-renamed.png Renamed

  3. Now you can see what changes were made in each file. Click the file to display its diff and compare its two revisions:

    commitsViewFileDiff.png

Viewing preferences

Click the gear icon to change the diff type (Inline. Unified, or Split) and choose other viewing options:

diffOptions.png

Unchanged blocks of code are hidden. You can reveal them by clicking on the cut lines:

inlineDiffCutLines.png

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:

  1. Let's say there is a branch Branch A with a file somefile.txt that contains the following lines:

    mergeDiffExample-1.png
  2. Create a branch Branch B off Branch A and change the file (the third line) in Branch B:

    mergeDiffExample-2.png
  3. In Branch A, make some other change to the file (the first line):

    mergeDiffExample-3.png
  4. Merge Branch B into Branch A.

    The resulting version of the file will include changes from both branches.

  5. Now you can navigate to the merge commit in SpaceCode and open the diff:

    mergeDiffExample-4.png

    We can see the diff because the final version of somefile.txt is different from its both parent versions: Branch A and Branch B.

Last modified: 24 May 2024