Fix Watch Command Not Showing Colors for ‘git status’

colorsgitwatch

I'm trying to get watch to display colors from 'git status'.

I've tried running watch with the --color option, as suggested elsewhere here, but, still, watch --color 'git status' doesn't display colors.

Best Answer

When git status is run under watch, it is able to detect that its standard output is not a terminal, meaning it will not output colors if the color.status setting is set to auto. To force git status to always output colors (even under watch), set color.stats to always, e.g.

git config color.status always

to set the setting permanently, or as @ChrisJonsen points out, use git -c color.status=always status to run git status with a one-time override.

Related Question