后 git config --global interactive.diffFilter diff-highlight
我的 .gitconfig
:
# This is Git's per-user configuration file.
[user]
name = Vitaly Zdanevich
email = vitaly.zdanevich@xxx.com
[core]
excludesfile = /Users/vitaly/.gitignore_global
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge --skip -- %f
process = git-lfs filter-process --skip
required = true
[diff]
tool = vimdiff
context = 20
[difftool]
prompt = false
[interactive]
diffFilter = diff-highlight
但在
git commit -p
和 git add -p
我逐行看到相同的差异 无色默认 terminal.app
:我也试过:
git -c interactive.diffFilter="git diff --color-words" add -p
并得到:
fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.
我的 git 版本是
2.17.2 (Apple Git-113)
在 macOS 10.14.1
来自官方的命令行工具,我更喜欢简单而不是 Brew。
最佳答案
关于git - `git config interactive.diffFilter diff-highlight` : the same diff by lines - and without color,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53213708/