如何在git log中更改标签/分支名称的颜色? [英] How to change the colors for tag/branch names in git log?
问题描述
当我运行命令 git log --graph --oneline --all --decorate
时,我会看到颜色的分支和标记名称(我想是因为我设置了 color.ui
更改为 auto
).我喜欢这种颜色,但是由于我有白色背景,所以很难读懂其中几种颜色,尤其是黄色.
When I run the command git log --graph --oneline --all --decorate
I see branch and tag names in color (I think since I set color.ui
to auto
). I like this, however a couple of the colors are very hard to read, especially yellow, since I have a white background.
I would like to change this, and I found (in the Git book under color.* here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) that you can change settings under color.*
to further customize Git's colors. However, none of the 4 subsettings (branch
, diff
, interactive
, and status
) seem to affect the colors used by git log for branch and tag names. Is it possible to change these colors, and if so how?
推荐答案
git log --graph
列颜色可通过以下方式配置:
The git log --graph
column colors are configurable through:
log.graphColors
默认设置为红色,绿色,黄色,蓝色,洋红色,青色,粗体红色,粗体绿色,粗体黄色,粗体蓝色,粗体洋红色,粗体青色
.
装饰名称(标签: tagname
, HEAD
,分支名称等)根据颜色进行着色.装饰.插槽
,其中 插槽
是分支
, remoteBranch
,标签
,隐藏
或 HEAD
.(此控件设置是Git 1.7.2中的新增功能,因此,如果您拥有Git 1.7.1或更早版本,则没有此设置.)
The decoration names (tag: tagname
, HEAD
, branch names, and so on) are colored according to color.decorate.slot
, where slot
is one of branch
, remoteBranch
, tag
, stash
, or HEAD
. (This control setting was new in Git 1.7.2, so if you have Git 1.7.1 or older you don't have it.)
还有更多控制旋钮:在 git config
文档中搜索单词 color
.
There are many more control knobs: search the git config
documentation for the word color
.
这篇关于如何在git log中更改标签/分支名称的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!