Why does git diffftool use git diff instead?

I want to git diff

be a quick command line solution to see the difference between two files, and then I want to be able to git difftool

run meld for a more graphical representation of the file differences.

It currently git diff

does exactly what I want, however when I run git difftool script.js

git tries to run vimdiff instead of meld:

Viewing (1/1): 'script.js'
Launch 'vimdiff' [Y/n]:

      

If I point the tool with git difftool -t meld script.js

, it tries to run meld as follows:

Viewing (1/1): 'script.js'
Launch 'meld' [Y/n]:

      

How do I get git difftool <filename>

to run meld while git diff <filename>

still using vimdiff?


My.gitconfig contains the following:

[diff]
     tool = vimdiff
[difftool]
    tool = meld
[difftool "meld"]
    path = C:\\Program Files (x86)\\Meld\\Meld.exe

      

+3


source to share


1 answer


git config --global diff.tool meld

      

This will set the default difftool offset. That is, when you call git difftool

without a parameter --tool

, git will run meld.



You can also remove this part of your config, git won't read difftool.tool

as it is not one of the git known config options :

[difftool]
    tool = meld

      

+3


source







All Articles