我在Windows中使用的是Git Bash,为了我的自定义git log
格式,我想修改终端的精确RGB颜色值,以便对颜色输出进行微调。在我的全局.gitconfig
中,我的git日志格式如下
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes --tags
例如,我想在Git Bash中定义RGB值实际映射到'blue‘的值。你知道我该怎么做吗?一步一步的指导是很棒的。提前谢谢。
编辑
我设置了我的.bashrc,但由于某种原因,它不能工作。颜色没有变化:-(。下面是我运行以查看颜色的脚本:http://pastebin.com/9EsYmGCj和结果:http://i.imgur.com/1dJ3o1a.png
发布于 2017-05-17 05:11:26
如果您使用的是git-bash命令提示符,请检查是否有以下文件:%USERPROFILE%.minttyrc
在该文件中,您可以通过以下方式微调控制台颜色的RGB值:
BoldBlack=128,128,128
Red=255,64,40
BoldRed=255,128,64
Green=64,200,64
BoldGreen=64,255,64
Yellow=190,190,0
BoldYellow=255,255,64
Blue=0,128,255
BoldBlue=128,160,255
Magenta=200,64,255
BoldMagenta=255,128,255
Cyan=64,190,190
BoldCyan=128,255,255
White=200,200,200
BoldWhite=255,255,255
发布于 2018-03-26 13:29:08
Git bash使用默认的Windows控制台颜色,可以在注册表中进行调整。例如,为了增加可读性,可以通过应用如下所示的更改来将暗红色和暗品红色更改为较亮的版本:
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
"ColorTable01"=dword:00800000
"ColorTable09"=dword:00ff0000
; GREEN LGREEN
"ColorTable02"=dword:00008000
"ColorTable10"=dword:0000ff00
; CYAN LCYAN
"ColorTable03"=dword:00808000
"ColorTable11"=dword:00ffff00
; RED LRED --> To increase readability, use e.g. 000000aa for "ColorTable04"
"ColorTable04"=dword:00000080
"ColorTable12"=dword:000000ff
; MAGENTA LMAGENTA --> To increase readability, use e.g. 00aa00aa for "ColorTable05"
"ColorTable05"=dword:00800080
"ColorTable13"=dword:00ff00ff
; YELLOW LYELLOW
"ColorTable06"=dword:00008080
"ColorTable14"=dword:0000ffff
; LGRAY WHITE
"ColorTable07"=dword:00c0c0c0
"ColorTable15"=dword:00ffffff
https://stackoverflow.com/questions/21243172
复制相似问题