How do you use the diff command against two source trees

﹥>﹥吖頭↗ 提交于 2019-12-11 17:07:08

问题


I tried running 'diff' against two source directories get a patch file with a 'diff' between the two directories.

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.


回答1:


Should work with any recent version of gnu diff (tested here with 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.




回答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?



来源:https://stackoverflow.com/questions/483849/how-do-you-use-the-diff-command-against-two-source-trees

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!