Posted 2022-08-02 with tags Vim, vimdiff, git, git difftool

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