git diff 顏色插件

使用對比git

git diff vs git diff --color | diff-so-fancygithub

安裝1npm

npm install -g diff-so-fancy

安裝2(Mac)less

brew install diff-so-fancy

能夠直接使用code

git diff --color | diff-so-fancy

也能夠添加到配置裏面去it

git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

添加到本身的配置~/.gitconfig配置

git config --global alias.dsf '!f() { [ -z "$GIT_PREFIX" ] || cd "$GIT_PREFIX" '\
'&& git diff --color "$@" | diff-so-fancy  | less --tabs=4 -RFX; }; f'

開源使用im

https://github.com/so-fancy/diff-so-fancyimg

相關文章
相關標籤/搜索