Question

On windows, I have two source files and want to create a patch with difference, like this one. But I'm unsure, what format this patch is and what app to use in order to create it? GNU diff output is very different from the patch I can see in the link above.

Was it helpful?

Solution

The output format is called "unified diff", it can be generated using diff -u.

OTHER TIPS

Try WinMerge. You'll find a patch generator in the "Tools" menu.

Thanks, PhiLho & Lukáš! The diff program from UnxUtils works great under Windows 7 to generate the patch file:

diff -u oldfile newfile >patchfile

Likewise, the patch program from UnxUtils works great to apply the patch:

patch -u oldfile patchfile

WinMerge is the best tool for windows. To create a patch file, you need to do the following:

File>Open

-- Here you open the files for which you are generating patch file.

Tools>Generate Patch

-- Here you specify the path where to save the patch file. And WinMerge will save patch file for you.

WinMerge (http://winmerge.org/) is what you need. You also can compare whole file trees with this tool, which is an absolute must-have for some people.

The UnxUtils package offers lot of useful Unix tools for Windows, with a minimal impact on Windows installation (unzip, add location to path, use it).
It has a diff.exe

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top