Using vimdiff as GIT diff tool

If you want to review and edit your currently pending changeset in GIT vimdiff can be very handy. The regular git diff will simply output differences in patch format. If you set up GIT to use vimdiff as diff tool you will be able to see the differences in VIM’s split window view and be able to edit them too.

To use vimdiff as GIT diff tool simply run those 3 commands:

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

Alternatively you can add these 3 sections to your .gitconfig

    tool = vimdiff
    prompt = false
    d = difftool

If you now run git d [file] you will see the changes in VIM. You can still use the regular git diff command to get the patch output.

Using vimdiff as GIT diff tool