How to colorize branch name in output of "git checkout"?

Viewed 181

How to colorize the branch name (shown in bold below) in the output of git checkout?

(base) dollaween $ git checkout develop
Switched to branch 'develop'
1 Answers

Color settings for different commands are controlled by the config variables

color.<command>.<slot>

You can see all available config variables with the command git help -c (see git config: list all variables and their default values). If there is no variable called color.checkout.… then I think this is not possible.

The closest replacement I could think of would be to colorize the branch name in the output of git status.

For example:

$ git config color.status.branch red
$ git status
On branch master
Your branch is up to date with 'origin/master'.
[…]

The bold part would now be red.

Related