2015-10-02

Git Colors

Git console uses nice colors to display its messages. But depending of the console you are using, the colors may not render at all, or may display in a way that is not readable... or to your likings.
Although there are many places that talk about setting git console colors, they usually only give a subset of them and not the complete list. As of 2015, this is the most complete list I could come up with.

Add these settings to you  ~/.gitconfig file.
For windows this is located in C:\User\[login]\.gitconfig

For complete documentation can be found here.


[color]
    ui = auto
    branch = auto|always|false
    diff = auto|always|false
    grep = auto|always|false
    interactive = auto|always|false
    pager = true|false
    showBranch = auto|always|false
    status = auto|always|false
[color "branch"]
    current = yellow reverse
    local = yellow
    remote = green
    upstream = cyan
    plain = white
[color "diff"]
    context = white
    meta = yellow bold
    frag = magenta bold
    old = red bold
    new = green bold
    commit = cyan
    whitespace = red reverse
[color "decorate"]
    branch = green
    remoteBranch = cyan
    tag = yellow
    stash = magenta
[color "grep"]
    context = white
    filename = green
    function = cyan
    linenumber = gray
    match =  yellow
    matchContext = yellow bold
    matchSelected = yellow reverse
    selected = white reverse
    separator = gray
[color "interactive"]
    prompt = white
    header = white
    help = white
    error = red
[color "status"]
    added = yellow
    changed = green
    untracked = cyan
    branch = cyan
    nobranch = magenta
    unmerged = red