You probably want to use
git config --global color.ui auto
The auto part says that git will only try and use color on terminals that support it, and you will not get ANSI sequences if you redirect output of git commands to a file for example. Setting it to true is same as auto, and this is also the default since Git 1.8.4.
The color.ui is a meta configuration that includes all the various color.* configurations available with git commands.
This is explained in-depth in git help config.
When color.ui is set to always it will always emit ANSI color characters, even when piping the output like git log | less while when set to auto it will not print colors unless the output is to the terminal.