`git config interactive.diffFilter diff-highlight`:按行显示相同的差异 - 并且没有颜色
`git config interactive.diffFilter diff-highlight`: the same diff by lines - and without color
在 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 版本是 macOS 10.14.1
来自官方命令行工具的 2.17.2 (Apple Git-113)
,我更喜欢简单而不是来自 Brew。
新 git 版本 (2.26.2)
似乎已修复
在 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 版本是 macOS 10.14.1
来自官方命令行工具的 2.17.2 (Apple Git-113)
,我更喜欢简单而不是来自 Brew。
新 git 版本 (2.26.2)
似乎已修复