Patch Files

Beyond Compare allows you to generate a Unix-style patch file of content differences.  Once you have a patch file, you can distribute it and use either Beyond Compare or a patch utility to update the original file with the changes.

Generating a patch file in Beyond Compare

BC3 logo BC version 3 or later

  1. In the Text Compare, select Session > Text Compare Report.
  2. In the Report Layout list, pick Patch and change the Patch Style to Normal diff.
  3. In the Output Options, pick Plain text and click Save As to generate the file.

BC2 logo BC version 2

  1. In the File Viewer, select File > File Differences Report.
  2. In the Report Layout list, pick Patch and change the Patch Style to Normal diff.
  3. In the Output Options, pick Plain Text and click Save As to generate the report.

Generating a patch for multiple files in Beyond Compare

BC3 logo BC version 3 or later

  1. In the Folder Compare, select Edit > Expand All.
  2. Edit > Select All Files.
  3. Actions > File Compare Report.
  4. In the Report Layout list, pick Patch and change the Patch Style to Normal diff.
  5. In the Output Options, pick Plain text and click Save As to generate the file.

BC2 logo BC version 2

  1. In the Folder Compare, select View > Expand All.
  2. Edit > Select All Files.
  3. Actions > File Differences Report.
  4. In the Report Layout list, pick Patch and change the Patch Style to Normal diff.
  5. In the Output Options, pick Plain Text and click Save As to generate the report.

Applying the patch

You can use a patch utility to apply changes to the original file:
    patch <original file> <patch file>

Or, you can use Beyond Compare (version 4 or later):

  1. Select Tools > View Patch and select a .diff or .patch file to view.
  2. In the Text Patch, select File > Apply Patch and select the original file.

Beyond Compare's Apply Patch command only supports single file patches.  Applying a multifile (folder) patch is not supported.

Tools and More Information

The GNU Win32 port of Patch:
gnuwin32.sourceforge.net/packages/patch.htm

More information on using Patch:
Introduction: Using Diff and Patch > Linux Academy