是否有一个 Git 环境变量来指示 color.ui
配置选项?它似乎不在文档中,如果有的话。
最佳答案
不幸的是,与其他一些设置不同,没有允许您覆盖 color.ui
配置选项的环境变量。
唯一的方法当然是使用命令行:git config --global color.ui true
你也可以直接编辑~/.gitconfig
文件然后添加所有这些颜色选项。所有这些信息都可以找到 here .将颜色添加到您的 ~/.gitconfig
文件:
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
突出差异中的空白
[color]
ui = true
[color "diff"]
whitespace = red reverse
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
关于git - 什么环境变量设置 Git Color.UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16676383/