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

标签 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。

最佳答案

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

git diff-highlight

关于git - `git config interactive.diffFilter diff-highlight` : the same diff by lines - and without color,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53213708/

相关文章:

git - 单文件git部署到服务器

git - 在暂存区显示文件的 git diff

Git 差异 : is it possible to show ONLY changed lines

git - 如何让 araxis merge 作为 git difftool 工作

git - 在 git 中如何区分 microsoft word 文档?

node.js - 无法在Windows上npm安装react-native

具有服务器和客户端的项目的 Git 存储库设置

git - 提交签名解决了什么问题或威胁?

mysql - 将 sql 模式文件的 git diff 转换为应用/撤消 sql 脚本

git - 为什么 git difftool 返回 "cannot run git-difftool--helper"错误?