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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityWhen 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.
watch
supports--color
? – jw013 Aug 31 '12 at 14:18git status
. Note thatauto
is insufficient forwatch
since output is not to a terminal. You'll have togit config color.status always
, at least for running underwatch
. – jw013 Aug 31 '12 at 16:54-c
option can be used to set a value forcolor.status
for a single command:git -c color.status=always status
– Chris Johnsen Sep 1 '12 at 4:50