possible duplicate : watch command not showing colors for 'git status'

running the following command: watch -n1 git --no-pager log --oneline --graph -20

reproduces what i expect only it strips colors. In the possible duplicate it says that git detects that stdout is not terminal and hence strips the colors but the solutions does not work for git log on my machine (osx high sierra, zsh)

note - the following code does give me the everything with colors - i'm just interested if watch can do it too:

while :
git --no-pager log --one-line --graph --20 
sleep 1

1 Answer 1


Rather than always forcing git to color, you can enable color for just one command with a flag:

git log --color

So your command would be:

watch --color -n1 git --no-pager log --color --oneline --graph -20

I'm not sure why the linked answer didn't work, but I hope this works better.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .