//home | tags | archives | about | grosu.nl | eulinux.org | RSS Feed

colored git output

floyd - Fri 24 January 2014 - linux, git, slackware

Ok, another issue I was facing after returning to Slackware:
I was getting weird escape codes in the terminal when issuing some git commands, like git log or git diff:

ESC[33mcommit e5f753a1ae0acf48110589ed654c1e1f67fd1a6fESC[m
Author: Floyd ****
Date:   Fri Jan 24 13:13:33 2014 -0800

    Initial commit

ESC[1mdiff --git a/README.md b/README.md
ESC[mESC[1mnew file mode 100644
ESC[mESC[1mindex 0000000..8813881ESC[m
ESC[1m--- /dev/nullESC[m
ESC[1m+++ b/README.md
ESC[mESC[36m@@ -0,0 +1,4 @@ESC[m

The fix is actually pretty simple, I needed to change the pager used by git:

git config --global core.pager "less -r"