How to make git output show red or orange color when it contains the word "error", "warning", or "Aborting"?
Asked Answered
P

1

10

Is there a way to make git's output to show colors for the important words such as "error", "warning", or "aborting"? (case insensitive).

There are times when I do a git pull and the output is several lines, and I don't usually read all of them, but down at the last line, there is a word "Aborting", which escaped my attention.

So is there a way to show words in colors that indicate some error conditions? By the way git config --global color.ui true or git config --global color.ui auto won't do it, as I intentionally created some merge conflict on the Mac and on Ubuntu and no color output came out. (I am using the latest git, on Mac, git 2.6.4, and on Ubuntu, git 2.7.2).

Pas answered 27/2, 2016 at 13:53 Comment(2)
I found a solution good enough for me: https://mcmap.net/q/484843/-how-to-colorify-git-errors-warnings-and-fatal-messagesLotze
This is a general shell solution rather than git specifically: superuser.com/questions/542074/…Tearjerker
L
1

It sounds like the issue might be with terminal color display in general, in which case there are many other posts that provide suggestions such as:

  1. Check your terminal emulator's settings - research based on the specific emulator you're using - eg. "issue with iTerm colors" or "issue with Gnome terminal colors"

  2. Confirm settings for your shell, eg:

    # Set CLICOLOR if you want Ansi Colors in iTerm2 
    export CLICOLOR=1
    
    # Set colors to match iTerm2 Terminal Colors
    export TERM=xterm-256color
    
Ld answered 26/4, 2023 at 12:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.