To expand on @Hi-Angel answer, we could use a wrapper script to find the diff-highlight contrib script and place it in $PATH. Then use the wrapper script in your .gitconfig.
The script will try to find contrib/diff-highlight. We will name the script wrapper diff-highlight and place it in $PATH:
#!/bin/sh # diff-highlight locates the diff-highlight script in the git source tree and # runs it. # https://github.com/git/git/blob/master/contrib/diff-highlight hilite= for prefix in /usr/share /usr/local/share; do # First try git-core directory if [ -f "$prefix/git-core/contrib/diff-highlight" ]; then hilite="/usr/share/git-core/contrib/diff-highlight" elif [ -d "$prefix/git-core/contrib/diff-highlight" ]; then hilite="$prefix/git-core/contrib/diff-highlight/diff-highlight" # Then try git contrib directory elif [ -f "$prefix/git/contrib/diff-highlight" ]; then hilite="$prefix/git/contrib/diff-highlight" elif [ -d "$prefix/git/contrib/diff-highlight" ]; then hilite="$prefix/git/contrib/diff-highlight/diff-highlight" # Try git directory elif [ -f "$prefix/git/diff-highlight" ]; then hilite="$prefix/git/diff-highlight" elif [ -d "$prefix/git/diff-highlight" ]; then hilite="$prefix/git/diff-highlight/diff-highlight" # Then try doc directory elif [ -f "$prefix/doc/git/contrib/diff-highlight" ]; then hilite="$prefix/doc/git/contrib/diff-highlight" elif [ -d "$prefix/doc/git/contrib/diff-highlight" ]; then hilite="$prefix/doc/git/contrib/diff-highlight/diff-highlight" fi if [ -n "$hilite" ]; then break fi done if [ -x "$hilite" ]; then exec "$hilite" "$@" elif command -v perl >/dev/null 2>&1; then perl "$hilite" "$@" else cat fi
You can also find this script in my dotfiles.
Then change the git pager to use the wrapper script:
$ git config --global core.pager 'diff-highlight | less' $ git config --global interactive.diffFilter 'diff-highlight'