`git config Interactive.diffFilter diff-highlight`:按行相同的diff-无颜色

时间:2018-11-08 18:08:21

标签: git git-diff git-difftool

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 -pgit add -p中,我在默认的terminal.app中看到相同的逐行差异没有颜色

git config interactive.diffFilter diff-highlight git diff without color

我也尝试过:

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。

1 个答案:

答案 0 :(得分:1)

看起来像新的git版本(2.26.2)所修复的

git diff-highlight