I tried running 'diff' against two source directories get a patch file with a 'diff' between the two directories.
我尝试对两个源目录运行'diff',在两个目录之间获得一个带有'diff'的补丁文件。
diff -rupN flyingsaucer-R8pre2_b/ flyingsaucer-R8pre2/ > a.patch
The command above does not seem to work, it generates a diff of everything and I get a 13 MB file, when in reality, it should be a couple of changes.
上面的命令似乎不起作用,它生成一切差异,我得到一个13 MB的文件,实际上,它应该是一些变化。
2 个解决方案
#1
Should work with any recent version of gnu diff (tested here with gnu diff 2.8.1.)
应该使用任何最新版本的gnu diff(在这里用gnu diff 2.8.1测试。)
You might want to add -b (and perhaps -B) to ignore difference in white space which perhaps generate large patch files unnecessarily.
您可能希望添加-b(可能还有-B)来忽略空白区域的差异,这可能会不必要地生成大型补丁文件。
#2
I don't see any reason why it wouldn't work. Try adding "wb" to the argument list to ignore whitespace changes. Are you sure you got the trailing slashes the same on both sides?
我没有看到为什么它不起作用的任何理由。尝试将“wb”添加到参数列表中以忽略空格更改。你确定你的两侧都有相同的斜杠吗?
#1
Should work with any recent version of gnu diff (tested here with gnu diff 2.8.1.)
应该使用任何最新版本的gnu diff(在这里用gnu diff 2.8.1测试。)
You might want to add -b (and perhaps -B) to ignore difference in white space which perhaps generate large patch files unnecessarily.
您可能希望添加-b(可能还有-B)来忽略空白区域的差异,这可能会不必要地生成大型补丁文件。
#2
I don't see any reason why it wouldn't work. Try adding "wb" to the argument list to ignore whitespace changes. Are you sure you got the trailing slashes the same on both sides?
我没有看到为什么它不起作用的任何理由。尝试将“wb”添加到参数列表中以忽略空格更改。你确定你的两侧都有相同的斜杠吗?