git - 使用带有 `git show` 的自定义差异工具

标签 git

使用 git 我可以在 .git/config

中设置自定义差异工具,用于某些文件扩展名
[diff "csv_diff"]
    command = Tools/csv_diff

这在 .gitattributes 中(在存储库的根目录中)

*.csv diff=csv_diff

这在使用 git diff 时有效,但不适用于 git show。我的问题是,如何通过 git show 使用自定义工具?

最佳答案

看起来您正在寻找 --ext-diff 选项。

这是git show docs说说:

--ext-diff

Allow an external diff helper to be executed. If you set an external diff driver with gitattributes, you need to use this option with git-log and friends.

关于git - 使用带有 `git show` 的自定义差异工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34885397/

相关文章:

git - git-stash 和 git-checkout 有什么区别?

git - 从 github.io 中删除自定义 url

ios - 在 Xcode 中为子模块复制工作副本

git - 您如何找出文件模式更改来自哪个提交?

带有数据库的 Github 项目

Git 列出所有分支标签和 Remote ,以及提交哈希和日期?

windows - 适用于 Windows 的 Git 无法正确处理网络目录

Git 忽略 gitconfig?

git - .gitignore 似乎不起作用

git - 如何保持两个 git repos 同步?