2013-05-21 75 views

回答

2

不幸的是,与其他一些设置不同,没有环境变量允许您覆盖color.ui配置选项。

唯一的方法是使用命令行:git config --global color.ui true您也可以直接编辑0​​文件并添加所有这些颜色选项。所有这些信息都可以在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 

突出的空白在的diff

[color] 
    ui = true 
[color "diff"] 
    whitespace = red reverse 
[core] 
    whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol 
+0

好吧,谢谢。我知道如何使用Git配置来设置它,但我想知道如果不执行命令是可能的。我想没有答案。 – Jonah