Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a patch file on windows?

Tags:

patch

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.

like image 714
grigoryvp Avatar asked Oct 30 '09 08:10

grigoryvp


People also ask

How do I create a patch file in Windows?

Use File -> Open... to open the two versions for comparison. This will give you a nice view of what you have changed. Then do Tools -> Generate patch .... In the dialogue box, make sure you select Style: Unified in the Format box.

What file type is a patch file?

The patch file (also called a patch for short) is a text file that consists of a list of differences and is produced by running the related diff program with the original and updated file as arguments. Updating files with patch is often referred to as applying the patch or simply patching the files.


2 Answers

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

like image 149
Aaron Digulla Avatar answered Sep 25 '22 14:09

Aaron Digulla


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 
like image 42
Dave Burton Avatar answered Sep 25 '22 14:09

Dave Burton