命令行递归基于单词的差异?
是否有一个命令行程序可以提供基于单词的递归差异(在两个目录上)?
diff -u
是递归的,但它不进行逐字比较。 wdiff
和 dwdiff
进行基于单词的比较,但没有用于递归比较的内置选项。
我想将结果通过管道传递给 colordiff
,因此生成 colordiff
可以理解的输出的程序将特别有用。有什么建议吗?谢谢!
抄送
is there a command line program that gives recursive word-based diff (on 2 directories)?
diff -u
is recursive, but it doesn't do word by word comparison. wdiff
and dwdiff
does word based diff but there are not built-in options for recursive diff.
I would like to pipe the result to colordiff
so a program that generates output that colordiff
understands would be especially useful. Any suggestions? Thanks!
CC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Git 可以做到这一点并输出颜色:
以下通常有效:
但一般来说,您可能需要这样做
两个文件甚至都不需要位于 git 存储库中!
如果您和路径位于 git 工作树中,则需要
--no-index
。如果您或其中一个文件位于 git 工作树之外,则可以将其删除。联机帮助页: https://git-scm.com/docs/git-diff/1.8 .5(及之后...)
Git can do it and output color:
The following often works:
but in general you may need to do
Neither file even needs to be in a git repository!
--no-index
is needed if you and the paths are in a git working tree. It can be elided if you or one of the files are outside a git working tree.Manpage: https://git-scm.com/docs/git-diff/1.8.5 (and later...)