How to adjust diff header color in git diff?

When I run 'git diff', part of the header of each diff is displayed in white text. Since I use a light background, it is hard to read, so I want to change it.

I found that I can change other colors on diff output like this (in .gitconfig ): [color "diff"] old = green new = red

But I can’t figure out what to add there for the title. Better yet, is there somewhere where all the default git config options are documented?

By the heading "diff" I mean the following lines: diff --git a/README.md b/README.md index f102026..c5e3428 100644 --- a/README.md +++ b/README.md

+6
source share
1 answer

Try setting color.diff.meta , for example

 git config --global color.diff.meta blue 

or manually editing the configuration file

 [color "diff"] meta = blue 

You can view various color. settings color. in the git-config link for more options. The color.diff.meta parameter is listed color.diff.meta :

color.diff.<slot>
Use the color option for color printing. <slot> indicates which part of the patch uses the specified color, and is one of plain (contextual text), meta (meta information), frag (hunk header), func (function in the hunk header), old (deleted lines), new (added lines), commit (fixing headers) or whitespace (highlighting whitespace errors). The values ​​of these variables can be specified as in color.branch.<slot> .

+11
source

Source: https://habr.com/ru/post/978219/


All Articles