Compare selected files using the Diff tool
Use the Diff tool to compare two selected files.
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.
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.
To specify display options for the Diff tool, select , then (or, if you are on a Mac, ) . 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
or .To replace the content of one file with another, select
or .