`git config Interactive.diffFilter diff-highlight`:按行相同的diff-无颜色 [英] `git config interactive.diffFilter diff-highlight`: the same diff by lines - and without color
本文介绍了`git config Interactive.diffFilter diff-highlight`:按行相同的diff-无颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在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
中,我看到相同的diff逐行无颜色:
But in git commit -p
and git add -p
I see the same diff line-by-line without color in default 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中的
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.
推荐答案
新git版本(2.26.2)修复了问题
Looks like fixed with new git version (2.26.2)
这篇关于`git config Interactive.diffFilter diff-highlight`:按行相同的diff-无颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文