2

When i do a git status I get nice pretty colors on my display.

However git push/pull/fetch are just monochrome boring

I have : git config color.ui always set to on but it appears I don't get no colors for anything other than status.

Am I missing something?

I'd love to see a red message pop out if something was rejected. Perhaps there is a way to wrap the git output in a color processor?

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration doesn't seem to talk about push/pull

i.e. I'd love to color my error line in red here:

To ssh://<REPO ADDRESS>
 ! [rejected]        develop -> develop (fetch first)
error: failed to push some refs to 'ssh://<REPO ADDRESS>'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I guess it might be possible to wrap it somehow in a script that if a line has error: it will make it red? I know there is a color maven "thing" out there that does something to maven output.

Jeef
  • 26,861
  • 21
  • 78
  • 156

1 Answers1

5

Looking for string color in push.h, pull.h or fetch.h, reveal that they don't use coloring functions of git.

But if you want to color git errors, you could use this solution from another stack overflow question: How to colorify git errors, warnings and fatal messages?

Community
  • 1
  • 1
Andrzej Budzanowski
  • 1,013
  • 11
  • 17