Git colors: How do I set colors for the upstream branch in “git branch -vv”?

谁都会走 提交于 2019-11-27 01:19:33

问题


I'm able to see my local and remote branches colored differently with the following configuration in my .gitconfig.

[color "branch"]
    current = bold cyan
    local = normal
    remote = bold red

In git branch -vv however, there is an additional upstream branch displayed that has a different color which is unreadable on my screen.

How do I configure this “upstream” color? (movie pun unintended :)

A git help config lists the color parameters for many branch types but I'm not able to find out one for this upstream branch.


回答1:


Looking at the source code, you want to use upstream as the slot name:

[color "branch"]
    upstream = bold blue

It looks like more up-to-date man pages also have the option listed. The ones you were looking at are probably older than 1.8.3 (which is when the feature first appeared).



来源:https://stackoverflow.com/questions/19012738/git-colors-how-do-i-set-colors-for-the-upstream-branch-in-git-branch-vv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!