Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've setup grep colors in my ~/.bashrc :

export GREP_COLORS='ms=01;34:mc=01;34:sl=:cx=:fn=35:ln=32:bn=32:se=36'

They work for

  • grep --color=auto
  • grep --color=always

Unfortunately, those custom colors are ignored by:

  • git grep --color=auto
  • git grep --color=always

How to make git grep to use above $GREP_COLORS colors ?

share|improve this question
1  
Git doesn't call the external grep utility, it has its own internal command which is called git grep and has similar but not identical options. –  Gilles Feb 2 '12 at 1:16
add comment

1 Answer 1

You should explicitly configure colors in git's configuration file.

Interesting information are found in git-config man page, in particular look for the configuration variable color.grep.<slot>

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.