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 tha
In Ubuntu or any other platform (yes, Windows too!); starting git1.8.4, which was released 2013-08-23, you won't have to do anything:
Many tutorials teach users to set "color.ui" to "auto" as the first thing after you set "
user.name/email
" to introduce yourselves to Git. Now the variable defaults to "auto
".
So you will see colors by default.
Another way is to edit the .gitconfig
(create one if not exist), for instance:
vim ~/.gitconfig
and then add:
[color]
diff = auto
status = auto
branch = auto
GIT uses colored output by default but on some system like as CentOS it is not enabled . You can enable it like this
git config --global color.ui true
git config --global color.ui false
git config --global color.ui auto
You can choose your required command from here .
Here --global is optional to apply action for every repository in your system . If you want to apply coloring for current repository only then you can do something like this -
git config color.ui true
Git automatically colors most of its output if you ask it to. You can get very specific about what you want colored and how; but to turn on all the default terminal coloring, set color.ui to true:
git config --global color.ui true
Add to your .gitconfig file next code:
[color]
ui = 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