Viewing all `git diffs` with vimdiff

chuckg picture chuckg · Sep 15, 2010 · Viewed 115.2k times · Source

I setup git diff to wrap into vimdiff, using "Git Diff with Vimdiff" as a guide, and it's working as expected unless there are many files with changes.

When there are multiple files with changes and I run git diff, it opens the first file and, after quitting the first instance of vimdiff, I'm presented with the following message:

external diff died, stopping at filename

This is a completely different behavior than I am used to. I had a similar setup in the past with SVN and, when diffing against multiple files, I would review the first file, then write and quit using :wq and the next file with differences would open up.

This is not the case with Git. I tried :n[ext], but doing so does not fill the left window with the original file so that it can be diffed against the modified version.

Answer

chuckg picture chuckg · Sep 15, 2010
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool

Typing git d yields the expected behavior, typing :wq in vim cycles to the next file in the changeset.