How to use diff and patch in Cygwin on Windows? -
I follow several articles from there, but I still do not know how to use differences in patch and how to use patch <
original.txt new.txt < / Strong> Then I have the Then I use How to remove it? Is it related to Unix and Windows file formats? P / s : I have CYGWIN_NT-6.1-WOW64 and Windows 7 64bit P> This is almost certainly a line-ending problem, you can fix it by running
one two three
one four five
diff -u original.txt new.txt & gt; File.patch
--- origin.txt 2013-03-21 15: 53: 20.062956800 +0700 +++ new.txt 2013-03-21 15 : 53: 29.191869600 +0700 @@ -13 +1.33@@ one-two-three. There is no new line at the end of the file + four + five \. No new line at the end of the file.
patch origin.txt & lt; File.patch which shows errors
patching file origin.txt failed in laugh # 1 1 of 1 laugh FAILED - saving the original.txt.rej file
dos2unix on the files first:
$ dos2unix original .txt new.txt $ patch origin.txt & lt; File.patch patching file origin.txt
Comments
Post a Comment