如何对两个源代码树使用diff命令 [英] How do you use the diff command against two source trees

查看:73
本文介绍了如何对两个源代码树使用diff命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试对两个源目录运行 diff,得到一个补丁文件,两个目录之间带有 diff。

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

上面的命令似乎不起作用,它会产生所有差异,我得到一个13 MB的文件,实际上应该进行一些更改。

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.

推荐答案

应该与gnu的任何最新版本一起使用diff(在这里使用gnu diff 2.8.1进行了测试。)

Should work with any recent version of gnu diff (tested here with gnu diff 2.8.1.)

您可能想添加-b(也许是-B)来忽略空格中的差异,而空格可能会产生较大的差异不必要的补丁文件。

You might want to add -b (and perhaps -B) to ignore difference in white space which perhaps generate large patch files unnecessarily.

这篇关于如何对两个源代码树使用diff命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆