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.

I'm available for contracting work. Check out my LinkedIn profile and my portfolio page for an overview of my skills and experience. If you are interested in working with me please use the contact form to get in touch.

Using vimdiff as GIT diff tool

One thought on “Using vimdiff as GIT diff tool

Leave a Reply

Your email address will not be published. Required fields are marked *