2013-05-21 72 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