How can I make `git diff` as fine-grained as StackExchange diff?

北慕城南 提交于 2019-12-03 21:44:24

You can try, from git diff:

git diff --color-word=.

Which is equivalent to --word-diff=color plus (if a regex was specified) --word-diff-regex=<regex>.

That would transform this git diff:

into this one:

Images are from the section "Produce more useful diffs" of the article "30 Git CLI options you should know about" written in Sept. 2014 by Christophe Porteneuve.

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