Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using custom diff tool with `git show`

Tags:

git

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?

like image 570
Khaelex Avatar asked Jan 19 '16 19:01

Khaelex


People also ask

How do I check my git diff tool?

Type git config diff. tool winmerge . Verify it worked by typing git difftool . Get rid of the prompt typing git config --global difftool.

Why is git diff not showing?

In answer to the original question, git diff isn't showing anything because you have a brand new directory, with a newly added file, but there are zero changes in the file for git diff to show. git status is showing that you added a new file, but git diff is for showing changes within files.


1 Answers

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.

like image 150
Lucas Trzesniewski Avatar answered Sep 21 '22 12:09

Lucas Trzesniewski