Installing/updating to the latest Git version, mostly using proper package management tools like HOMEBREW, can usually solve problems related to installations and missing scripts/tools.
For some reason my system also did not find diff-highlight when issuing Git commands. While double checking it I figured out that I had diff-highlight set for my global Git as a pager, and whenever I tried to execute git sub-command (status/show/log) the non found pager wanted to come into play:
/ > git log
/usr/local/share/git-core/contrib/diff-highlight/diff-highlight | less -r: /usr/local/share/git-core/contrib/diff-highlight/diff-highlight: No such file or directory
After installing Git again via brew install git
or brew update git
, it got updated to the latest (2.13.x) version, as well as all the Git tools/files have been reset to its normal place. To obtain where the brew installation puts the scripts/tools and Git commands, files, you can issue:
/ > brew info git
git: stable 2.13.0 (bottled), HEAD
Distributed revision control system
https://git-scm.com
/usr/local/Cellar/git/2.13.0 (1,463 files, 33.2MB)
Under my ~/dotfiles folder where I store my global settings, amongst others also for Git, I updated the pager setting to the proper location of the diff-highlight in the ~/dotfiles/git/gitconfig file:
[core]
excludesfile = /Users/<user_name>/.gitignore_global
pager = /usr/local/Cellar/git/2.13.0/share/git-core/contrib/diff-highlight/diff-highlight | less -r
For the global settings I am using a customized version of Jack's Dotfiles.