有没有一种简单的方法来设置Notepad ++的Compare插件作为Windows上Git的diff工具?我不确定它是否可以从命令行调用,所以可能没有.
如何从命令行启动Notepad ++,提供两个文件并使用diff/compare打开它?
我在那里关注了很多文章,但我仍然不知道如何在Cygwin中使用diff和patch
这里我在Windows资源管理器中创建2个文件
origin.txt
one
two
three
Run Code Online (Sandbox Code Playgroud)
new.txt
one
four
five
Run Code Online (Sandbox Code Playgroud)
然后我diff -u origin.txt new.txt > file.patch结果这个
--- origin.txt 2013-03-21 15:53:20.062956800 +0700
+++ new.txt 2013-03-21 15:53:29.191869600 +0700
@@ -1,3 +1,3 @@
one
-two
-three
\ No newline at end of file
+four
+five
\ No newline at end of file
Run Code Online (Sandbox Code Playgroud)
然后我patch origin.txt < file.patch显示错误
patching file origin.txt
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file origin.txt.rej
Run Code Online (Sandbox Code Playgroud)
怎么克服这个?这与Unix和Windows文件格式有关吗?
P/S:我正在使用CYGWIN_NT-6.1-WOW64和Windows …