Dariusz on Software

Methods and Tools

About This Site

Software development stuff

Archive

Coloured GIT output
Sun, 13 Jun 2010 06:33:00 +0000

Coloured git output on console is a very helpful feature. It was enabled by default on git interface cogito. I liked it, but had to switch to raw git few years ago (cogito is deprecated now).

Fortunately current version of GIT supports that nice feature. It can be enabled with few settings in ~/.gitconfig file:

[diff]
color = true

[pager]
color = true

[status]
color = true

Additionally pager used (less in my case) should support ANSI colors (~/.bash_profile):

export LESS="-R"

And now diffs are rendered using colors that improve readability (anyone who doesn't review changesets before commit? ;-) ). Now diffs look much better on a X terminal:

Tags: git.

Tags

Created by Chronicle v3.5