在`git show`中使用自定义比较工具 [英] Using custom diff tool with `git show`
问题描述
使用git,我可以在 .git / config
$ b中设置一个用于特定文件扩展名的自定义比较工具$ b pre code $ diff $ csv_diff
command = b
以及
<$ 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 withgit-log
and friends.
这篇关于在`git show`中使用自定义比较工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!