Better Diffs with Git 2.9.0

With the latest git (2.9.0) you can now apparently setup diffs which weren’t possible before.

I use so-fancy/diff-so-fancy to get diffs

  • Without the +/- at the beginning of each line
  • Clear headers between different files in a diff
  • Clean headers describing where the file the diff is
  • Highlights of what changed on that line

And with the latest version of git the diff engine is smarter with blocks so it won’t think you inserted a new if/for in the middle of an existing one.

To install:

brew update
brew install git # 2.9.0+
brew install diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

Screenshot