Git 颜色:如何在“git branch -vv"中为上游分支设置颜色? [英] Git colors: How do I set colors for the upstream branch in “git branch -vv”?
问题描述
使用 .gitconfig 中的以下配置,我可以看到本地和远程分支的颜色不同.
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
然而,在 git branch -vv
中,显示了一个额外的上游分支,它具有不同的颜色,在我的屏幕上是不可读的.
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 :)
git help config
列出了许多分支类型的颜色参数,但我无法为这个上游分支找到一个.
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.
推荐答案
看源码,想用upstream
作为槽名:
Looking at the source code, you want to use upstream
as the slot name:
[color "branch"]
upstream = bold blue
看起来更新的手册页也列出了该选项.您正在查看的版本可能早于 1.8.3(该功能首次出现时).
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).
这篇关于Git 颜色:如何在“git branch -vv"中为上游分支设置颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!