When a git push fails due to something like:
! [rejected] develop -> develop (fetch first)
How would one color this type of error in the terminal?
When a git push fails due to something like:
! [rejected] develop -> develop (fetch first)
How would one color this type of error in the terminal?
You don't color it with Git itself.
That error message is done on stderr.
Independently of Git, you can try and apply color to stderr.
You have other options at "How to colorify git errors, warnings and fatal messages?".
For instance, the project sickill/stderred
is illustrated in this article:
Note: with Git 2.18 (Q2 2018, 4 years later), that kind of error message on push will actually be colored!
See more at "How to colorify git errors, warnings and fatal messages?".