Colors in Git

git has supported a “–color” argument for several commands, like diff and log. However, there wasn’t an easy way to make colorized output the *default* nor could you change the colors.

No more.

If you are running git 1.5 or above, you can turn on color by default and also change the colors. Put the following in your “.git/config” file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[color]
  branch = auto
  diff = auto
  status = auto
[color "branch"]
  current = yellow reverse
  local = yellow 
  remote = green
[color "diff"]
  meta = yellow bold
  frag = magenta bold
  old = red bold
  new = green bold
[color "status"]
  added = yellow
  changed = green
  untracked = cyan

Modify to suit your taste and enjoy!

Comments