Khaelid Khaelid - 2 months ago 15
Git Question

Using custom diff tool with `git show`

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
?

Answer

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.