I am writing a tool that runs git commands and captures the output, and I want the color to be highlighted. git notices that the tool is not a terminal, so color.ui needs to be set to always . I really don't want to install this in the global / repo configuration file, since it will work with other programs using git. git book does not explicitly encourage this:
You rarely want color.ui = always. In most scenarios, if you need color codes in your redirected output, you can instead pass the -color flag to the git command to force it to use color codes. The value color.ui = true is almost always used by you.
Unfortunately, not all git commands support the --color flag, especially git status and git pull .
So how can I force colors for a single git command? Is it possible to configure a configuration variable, for example. for custom git configuration file?
git
Yogu Apr 16 '14 at 11:04 2014-04-16 11:04
source share