The result of git by git diff --word-diff is great. But how to do diff like git diff --word-diff without git on Linux? The plain diff command on Linux seems not accept options like --word-diff.
git diff --word-diff产生的git效果很好。 但是如何在Linux上没有git的情况下像git diff --word-diff diff一样git diff --word-diff ? Linux上的diff命令似乎不接受--word-diff类的选项。
The wdiff is for word-diff:
wdiff用于单词差异:
wdiff program is a front end to diff for comparing files on a word per word basis. A word is anything between whitespace.
wdiff program是diff的前端,用于比较每个单词一个单词的文件 。 单词是空格之间的任何内容。
$ wdiff file1 file2
Bonus: colordiff is a wrapper for ‘diff’. colordiff is written in Perl and produces the same output but with pretty ‘syntax’ highlighting.
奖励: colordiff是'diff'的包装。 colordiff用Perl编写,并产生相同的输出,但突出显示“语法”。
$ wdiff file1 file2 | colordiff
or
要么
$ wdiff file1 file2 | colordiff | less -R
翻译自: https://www.systutorials.com/how-to-do-diff-like-git-diff-word-diff-without-git-on-linux/
本文介绍在没有Git的Linux环境下,如何使用wdiff命令实现类似git diff --word-diff的功能,以及如何结合colordiff增强输出效果。

925

被折叠的 条评论
为什么被折叠?



