Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change RGB colors in Git Bash for windows?

I'm using the Git Bash in Windows and for the purposes of my custom git log format, I'd like to modify the terminal's exact RGB color values so I can fine-tune the color outputs. My git log format is as follows in my global .gitconfig:

lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes --tags 

I'd like to define in Git Bash what RGB value actually maps to 'blue', for example. Any idea how I can do this? Step by step instructions would be wonderful. Thanks in advance.

EDIT

I setup my .bashrc and it isn't working for some reason. Colors aren't changing :-(. Here is a script I ran to see colors: http://pastebin.com/9EsYmGCj and the result: http://i.imgur.com/1dJ3o1a.png

like image 862
void.pointer Avatar asked Jan 20 '14 20:01

void.pointer


People also ask

What does yellow mean in git?

Yellow means the branch is both ahead of and behind its remote.


Video Answer


1 Answers

This works for me to change the text colors used by Git Bash on Windows 7:

  • Click on the upper left corner of an open Git Bash window (the Git icon in the window frame).
  • A menu appears (the same that would appear with a regular DOS cmd Window). Choose the last entry: "Properties", UPDATE 2021: "Options..." (thanks AlexD!)
  • Go to tab "Colors"
  • Choose radio button "Screen Text"
  • Remember which color is currently assigned to "Screen Text" in the row of small color boxes (it has a black frame).
  • Then select the color you want to change by clicking on the corresponding color box. This color is now assigned as "Screen Text", which is what Git Bash uses for regular text. But don't worry, this change is only temporary and needed to modify the value of a color.
  • Now change the Red/Green/Blue values for the selected color. In my case I wanted to make the fifth color from the left (much) brighter. Let's call it "Color 5". This is the color Git Bash uses to show changed files with "git status". Whenever Git Bash wants to use "Color 5" it will use the new RGB value.
  • "Screen Text" is now still set to "Color 5". So click on the original color that you have remembered.

The changes made in this way are permanent but only valid for the shortcut you have used to start Git Bash. If you create a new shortcut you are back to the original colors.

like image 163
StaticNoiseLog Avatar answered Sep 20 '22 13:09

StaticNoiseLog