`git config interactive.diffFilter diff-highlight`: the same diff by lines - and without color

一世执手 提交于 2019-12-01 07:07:36

问题


After git config --global interactive.diffFilter diff-highlight my .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

But in git commit -p and git add -p I see the same diff line-by-line without color in default terminal.app:

Also I tried:

git -c interactive.diffFilter="git diff --color-words" add -p

And get:

fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.

My git version is 2.17.2 (Apple Git-113) on macOS 10.14.1 from the official Command Line Tools, I prefer simplicity so not from the Brew.

来源:https://stackoverflow.com/questions/53213708/git-config-interactive-difffilter-diff-highlight-the-same-diff-by-lines-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!