在`git show`中使用自定义比较工具 [英] Using custom diff tool with `git show`

查看:119
本文介绍了在`git show`中使用自定义比较工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用git,我可以在 .git / config


$ b中设置一个用于特定文件扩展名的自定义比较工具$ b pre code $ diff $ csv_diff
command = b

以及 .gitattributes (位于存储库的根目录中)



<$ p $ *。csv diff = csv_diff

使用 git diff ,但它不适用于 git show 。我的问题是,如何使用 git show

解决方案

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



以下是 git show 文档对此进行说明:


- ext-diff

允许外部diff助手执行。如果您使用 gitattributes 设置外部差异驱动程序,则需要通过 git-log 和朋友使用此选项。



With git I can set a custom diff tool that is used for certain file extensions by the following in .git/config

[diff "csv_diff"]
    command = Tools/csv_diff

and this in .gitattributes (in the root of the repository)

*.csv diff=csv_diff

This works when using git diff, but it doesn't work with git show. My question is, how do I use a custom tool with git show?

解决方案

Looks like you're looking for the --ext-diff option.

Here's what git show docs say about it:

--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 show`中使用自定义比较工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆