http://michael.otacoo.com/linux-2/avoid-escape-characters-in-git/
The first one is to change the pager to “more”.
git config --global core.pager more
The second one is to append an additional command with “less -r”.
git diff --color | less -r
git log -p --color | less -r
And you get a nice colored output.
Here is another solution which is more portable to my mind, and it is the one I use.
git config --global core.pager "less -r"
This directly appends the modified less command when git pager is invocated to print correctly escape characters.
Avoid escape characters in GIT