Previous Next

Code Compare Integration with Perforce

In order to set Code Compare as the default diff tool for Perforce, perform the following steps:

  1. Go to Edit → Preferences → Diff, select "Other application".
  2. Enter the following data in the respective fields:

    Location: "[InstallationDir]\CodeCompare.exe"

    Arguments: %1 %2

In order to set Code Compare as the default merge tool for Perforce , do the following:

  1. Create a .bat file. To do that, create a text document and change its extension from .txt to .bat. Then, open it with any text editor and add the following line:

    "c:\Program Files\Devart\Code Compare\CodeMerge.exe" /BF=%1 /TF=%2 /MF=%3 /RF=%4 /SC=P4

    Save and close the document.

  2. Go to the Perforce Settings: "Edit → Preferences → Merge", select "Other application".
  3. Enter the following data in the respective fields:

    Location: "[path to the .bat file]"

    Arguments: %b %1 %2 %r

In order to use Code Compare with the Perforce command line:

  1. For Diff, execute the following command to specify the path to CodeCompare.exe:

    p4 set P4DIFF="[InstallationDir]\CodeCompare.exe"

  2. For Merge, execute:

    p4 set P4MERGE="[path to the previously created .bat file]"


Note: Use your product installation folder instead of [InstallationDir]. By default, it is C:\Program Files\Devart\Code Compare.

For a brief introduction to the features of our diff and merge tool, refer to the product's overview page.