Colorizing Git output

There is a simple tweak to make working with Git a lot nicer that people often don’t know about, or forget to do is turn on Git’s ability to colorize its output.

From the command line you can git config --global color.ui auto, or edit your .gitconfig directly.

  ui = auto

This will automatically colorize (among other things) the output from git log, git status, git show, and git add -i.

For example, git status will now show files with staged changes in green, and unstaged and untracked files in red. As shown below:

Colorized 'git status' output

Another example of the improved output after setting the colorization option is how git add -i will colorize the shortcut letters of its various commands.

Colorized 'git add -i' output