Why don't git colors show up in iTerm2

Robert Ross picture Robert Ross · Sep 15, 2011 · Viewed 35.4k times · Source

So I have my gitconfig setup to do colors. In Terminal it works great, looks fine.

In iTerm2, however, the colors don't appear for my gitconfig at all unless I set the reverse property for git. Then they appear but who likes reversed colors anyways?

Why does this happen and how can I fix it?

Answer

Matt picture Matt · Sep 15, 2011

You should check that iTerm is setting the TERM variable correctly. On my system, I see:

echo $TERM
xterm-256color

And have working colours in git. This is set according to the 'Report Terminal Type' property in iTerm's preferences.

here's a screenshot of iTerm 2's preferences

You should also check the Colors tab, and ensure the contrast slider isn't all the way to the right.