A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

vimdiff fun with git

Step 1: add this to your .gitconfig
[diff]
  external = git_diff_wrapper
[pager]
  diff =


Step 2: create a file named git_diff_wrapper, put it somewhere in your $PATH
#!/bin/sh
vimdiff "$2" "$5"


Still have access to the default git diff behavior with the --no-ext-diff flag. Here’s a function to put in your bash configuration files:
function git_diff() {
  git diff --no-ext-diff -w "$@" | vim -R -
}


Source: http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/