Compare selected files using the Diff tool

Use the Diff tool to compare two selected files.

Select Tools > Diff, and specify the left and right files.
Tip: If your Diff output is too large, you can reduce it by selecting Try hard to find a smaller set of changes. This might cause Diff to run more slowly.
Note: Alternatively, you can open files in Diff mode from the command line using generostudio -diff file1 file2.

Specify how the differences are displayed by using these options from the Diff menu:

Diff View
Displays differences between the files in a single pane document. This is also called single pane diff mode. Added and modified lines are highlighted. Deleted lines are identified by location but not displayed.
Diff View with Deleted Blocks
Displays differences between the files in a single pane document. Added, modified, and deleted lines are highlighted.
Vertical Dual Diff View
Displays the left and right files vertically.
Horizontal Dual Diff View
Displays the two files horizontally. The "left file" displays on the top and the "right file" displays on the bottom.

Dual diff views are also called two pane diff mode.

Example: Vertical Dual Diff View

This figure shows Vertical Dual Diff View. Side-by-side comparison shows the differences between files.

Figure: Vertical Dual Diff View display mode

This figure is a screen shot of the Vertical Dual Diff View.

Viewing differences between files

The Diff tool flags differences between files with color-coded markups in the Code Editor gutter. The default colors are:

  • Green - added lines
  • Orange - modified lines
  • Red - deleted lines

Locate differences between the files by using the navigation options from the Diff menu: First Difference, Previous Difference, Next Difference, and Last Difference.

Tip: You can also move through the differences using the diff toolbar arrows (next to Difference 1 of N). If these arrows are not visible, open the Code Editor Preferences and select Show diff options in editor.

To specify display options for the Diff tool, select Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences), then Code Editor > Diff Preferences. See Diff tool preferences for further details.

Copying changes between files

You can copy content from one file to another. The file on the left (in Vertical View) or the top (in Horizontal View) is treated as the "base file". The file on the right (in Vertical View) or the bottom (in Horizontal View) is treated as the "user file".

To copy a single change, place the cursor in the line of marked code and select Diff > Copy to User File or Diff > Copy to Base File.

To replace the content of one file with another, select Diff > Copy All to User File or Diff > Copy All to Base File.