Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing "git status" output colors in Posh-Git

In Posh-Git, when I run "git status" in a repository, the colors for changes and untracked files are dark red, when I have tried to configure them to be "normal" red. I want to do this because I have a console with a dark background, so dark red is difficult to read.

I searched around, and there seem to be two configuration changes which I needed to make:

  1. Change "WorkingForegroundColor" and "UntrackedForegroundColor" from "DarkRed" to "Red" in $GitPromptSettings.

  2. Change "color.status.changed" and "color.status.untracked" to red in git config.

From my reading, that's all I should need to do, and yet the results of "git status" remain dark red.

Here's a summary, to prove I set them as I claimed, and maybe someone can spot the error:

screenshot

like image 599
NightShovel Avatar asked Aug 24 '13 15:08

NightShovel


People also ask

What do the colors mean in git?

Green means the branch is ahead of its remote (green light to push) Red means the branch is behind its remote. Yellow means the branch is both ahead of and behind its remote.


1 Answers

The output of git status is controlled by your .gitconfig file. The default for changed and untracked files is a dim Red but you likely want Red Bold which is the bright (default) red you have in the prompt.

Add the following to your .gitconfig file:

[color]     ui = true [color "status"]     changed = red bold     untracked = red bold     added = green bold 

For anyone else referencing this in the future, the accepted colours are normal, black, red, green, yellow, blue, magenta, cyan, and white as well a single optional modifier bold, dim, ul, blink, or reverse. If two colours are given the first is the foreground, and the second is the background.

like image 139
WarrenB Avatar answered Sep 21 '22 17:09

WarrenB