2

I used the commands following commands in order to make vimdiff my default diff tool under git.

# git config --global diff.tool vimdiff
# git config --global difftool.prompt false
# git config --global alias.diff difftool

My git config file looks like the below when I type

# git config -l

diff.tool=vimdiff
merge.tool=vimdiff
difftool.prompt=false
alias.diff=difftool
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
branch.master.remote=origin
branch.master.merge=refs/heads/master

When I run git diff it still uses the less method and displays my diff in line instead of using the vimdiff program. What am I missing in my config that prevents git from using vimdiff?

ILikeTurtles
  • 1,012
  • 4
  • 16
  • 47
  • If I use the command `git difftool master` it works just fine. Only when I try to use the alias of diff does it no longer work as expected. – ILikeTurtles Nov 14 '15 at 13:23
  • Can you remove the git alias, just to check if that work better? – VonC Nov 14 '15 at 13:23
  • @Roman Thanks. I really wanted to use Git Diff for vimdiff but it looks like that will be impossible. I will create an alias for another word and use that. Turn your comment into an answer and I will accept it. – ILikeTurtles Nov 14 '15 at 13:37

1 Answers1

3

From man git-config:

To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored.

diff is an existing git command, so your alias is ignored.

Roman
  • 6,486
  • 2
  • 23
  • 41