偶然间发现了git 2.9可以支持更好看的Diff功能了,如下:
只好先update brew
brew update
再更新git
brew upgrade git
然后就看着它更新了:
==> Upgrading 1 outdated package, with result:
git 2.9.0
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.9.0.el_capitan.bottle.tar.gz
接着,需要link这个工具:
ln -s /usr/local/Cellar/git/2.9.0/share/git-core/contrib/diff-highlight/diff-highlight /usr/local/bin/
然后配置:
git config pager.diff 'diff-highlight | less'
也可以配置到其他几个不同的命令:
$ git config pager.log 'diff-highlight | less'
$ git config pager.show 'diff-highlight | less'
$ git config pager.diff 'diff-highlight | less'
顺便的:
git config interactive.diffFilter diff-highlight
围观我的Github Idea墙, 也许,你会遇到心仪的项目