开发者

How to create a patch file on windows?

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 di开发者_运维技巧fferent from the patch I can see in the link above.


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


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


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


In Beyond Compare 4 you can generate a unified diff by selecting the 'Session' > 'Text Compare Report...' menu item and then selecting 'Patch' for the layout and 'Unified diff' for the patch style. Then save the output to file, or to the clipboard.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜