How can I change the output colors of `git branch -vv`

I see that it takes a --format argument:

       --format <format>
           A string that interpolates %(fieldname) from a branch ref being shown and the object it points at. The format is the same as that of git-for-each-ref(1).

When I look at man git-for-each-ref I find

 When unspecified, <format> defaults to %(objectname) SPC %(objecttype) TAB %(refname).

and at the bottom it has these examples:

           --format='From: %(*authorname) %(*authoremail)
           Subject: %(*subject)
           Date: %(*authordate)
           Ref: %(*refname)

           %(*body)
           ' 'refs/tags'

--format="ref=%(refname)"

and then some more that I understand even less.

All I want is to change the shade of blue here. Help, please!
enter image description here

Asked By: Franklin

||

TLDR;

  • git config -g color.branch.upstream 'red bold'

Git Command:

git config color.branch.upstream '<fg-color> [<bg-color>] [<attribute>...]'

Git config file:

[color "branch"]
    upstream = <fg-color> [<bg-color>] [<attribute>...]

Possible <fg-color> and <bg-color> values:

black   blue   cyan  default  green
magenta normal red   white    yellow

Optionally prefixed with bright for brighter shades of those colours or use #RRGGBB values.


Possible <attribute> values:

blink   bold   ul   italic
reverse strike dim

Examples:

git config color.branch.upstream 'yellow red bold ul'
git config color.branch.upstream brightblue
git config color.branch.upstream '#c0c0ff'

See the git-config(1) man page for details and be aware that not every terminal supports everything. Also don’t forget to use the –global flag to make the changes global 🙂

Answered By: Bog
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.