When I make small changes to long lines, the standard git diff display can be a little hard to read.
A community script that improves this view was merged into the git trunk and released with git 1.7.10.
This tip has some brew specific path prefixing - but as long as you specify the path to diff-highlight it will work on any OS.
Find the path to
- on macOS, it should be
brew --prefix git/share/git-core/contrib/diff-highlight/diff-highlight
- on RPM based Linux, it should be
Add this to your Git config:
# Using the macOS path here for simplicity. Replace it for your OS.
pager = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | less
Add it with a shell one-liner:
$ git config --global core.pager "`brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | less"