Patch files are a lightweight way to distribute code changes without sharing the entire file. WinMerge can both generate and apply patch files in standard diff formats.

What is a Patch File?

A patch file (usually ending in .diff or .patch) contains a compact description of the differences between two files. Instead of sending the whole file, you send just the changes — which the recipient applies on top of their original file.

Creating a Patch File in WinMerge

  1. Open a file or folder comparison in WinMerge
  2. Go to Tools → Generate Patch
  3. Choose the patch format:
    • Normal — simple format, widely compatible
    • Context — includes surrounding lines for context
    • Unified — most popular; used by Git and most tools
  4. Set the output file path and click Create

What a Unified Patch Looks Like

--- original.txt 2025-06-01 +++ modified.txt 2025-06-24 @@ -3,7 +3,7 @@ function greet(name) { - return "Hello " + name; + return `Hello, ${name}!`; }

💡 Tip: Always use Unified format when creating patches for Git or open-source projects — it's the standard and most tools expect it.

Applying a Patch File

To apply a patch using WinMerge, go to Tools → Apply Patch, browse to the .diff or .patch file, select the target file, and click Apply. WinMerge will show you the result before saving.

Resolving Conflict Files

WinMerge can also open Git conflict files directly (files with <<<<<<<, =======, and >>>>>>> markers) and help you resolve them visually using the 3-way merge view.