Diff

Diff lets you see what changes have been made in your goormIDE before committing to your linked Git account.

How to use Diff

In the [Git] > [Changes] tab, clicking a file opens the Diff Tool, which lets you see the changes to the source code in the editor.

[Note] If you open the [Git] tab and there is only a [Register repository] button, you need to connect the repository first. See how to connect on Import Github Repos page.

There are 2 areas in the Diff Tool;

  1. The editor area is where you can see the changes you've made to the source code.

  2. The button area is where provides convenience features available in the Diff Tool.

The editor area

You can compare the source code before the change (left) and the source code after the change (right).

In the pre-change source code, lines of code that were deleted are highlighted in red and marked with a - next to the line number. In the after-change source code shows the lines of code that were added with a green highlight and a + next to the line number. Also, the code that was actually changed is highlighted darker.

Tip: The status of the file determines which source code is compared.

If you open the Diff Tool from a file that is ‘off-stage’, the source code before the change is the source code as of the last commit, and the source code after the change is the source code you are currently working on.

If you open the Diff Tool from a ‘staged file’, the pre-change source code is the source code at the last commit and the post-change source code is the source code at the time it was added to the stage, and modifying the source file does not modify the source code in the Diff Tool.

The button area

The buttons area in the top right corner of the screen provides 4 functions.

  1. Open file: Opens the Diff Tool's source file editor for the file you are currently viewing.

  2. Previous change, Next change: Moves the cursor to the previous, next change of the current cursor in the source code area after a change.

  3. Toggle collapse unchanged regions: Unchanged source code areas are hidden. If the unchanged source code area is small, it may not be hidden. Click the button one more time to see the full source code again.

  4. Change the way the editor area is viewed: You can change the placement of the source code before changes and the source code after changes. Click the Split button to change to a left-to-right orientation, or the Inline button to change to a top-to-bottom orientation.

  • Button area reference image

Last updated