Vimdiff a File From Another Git Branch

Command to Compare File Against a Different Branch

git difftool staging -- app/FdaDrug.php.php

In this example:

  • staging is the branch name
  • -- separates branch name from the file to diff
  • app\FdaDrug.php is the file to diff

How to Set Vimdiff as Git's Diff Tool

git config --global diff.tool vimdiff


 vim  vimdiff  git  git difftool