Diffing Text Files

In its diff mode, P4Merge enables you to compare two text files to locate differences. (P4Merge can also diff image files and, if your Perforce administrator has enabled it, Microsoft Word .docx files.) The purple icon () is associated with the first file you selected, and purple bands highlight text that is in the first file but not the second file. The green icon () is associated with the second file you selected, and green bands highlight text that is in the second file but not the first file.

To display diffs in a single pane, go to View > Single Pane Diff Layout. In single-pane mode, deleted text is shown using strikethrough text. By default, P4Merge displays diffs in a side-by-side layout.

To toggle the display of line numbers, click .

Navigate Diffs

To move forward and back through individual differences, or to locate specific text or lines, click the toolbar buttons listed below.

Go to next/previous diff

Find text

Go to line number

Set Preferences

To configure P4Merge settings to display or suppress differences in white space and line endings, click or choose File > Comparison Method. To configure other settings, go to Edit > Preferences (Windows) or P4Merge > Preferences (Mac).

Note

If you are comparing Unicode files, selection of the correct character set is essential. If you select the wrong character set, P4Merge cannot correctly diff files.