I recently saw that the git
console in Windows is colored, e.g. Green for additions, red for deletions, etc. How do I color my git
console like that?
To install it, I used the command: $ sudo apt-get install git-core
As noted by @VonC, color.ui
defaults to auto
since Git 1.8.4
From the Unix & Linux Stackexchange question How to colorize output of git? and the answer by @Evgeny:
git config --global color.ui auto
The
color.ui
is a meta configuration that includes all the variouscolor.*
configurations available withgit
commands. This is explained in-depth ingit help config
.
So basically it's easier and more future proof than setting the different color.*
settings separately.
In-depth explanation from the git config
documentation:
color.ui
: This variable determines the default value for variables such ascolor.diff
andcolor.grep
that control the use of color per command family. Its scope will expand as more commands learn configuration to set a default for the--color
option. Set it toalways
if you want all output not intended for machine consumption to use color, totrue
orauto
if you want such output to use color when written to the terminal, or tofalse
ornever
if you prefer git commands not to use color unless enabled explicitly with some other configuration or the--color
option.