Search code examples
gitvimdiff

Please review my config. My vimdiff not working with GIT after setup


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?


Solution

  • 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.