Add colors to git command output

Instead of seeing a plain output after a git command we can have the display in color.

like when we execute git status to view changed or new files we can view each segment in colored way:

or for when we execute git diff a_modified_file_name

it is better to view deleted lines in red (-) and added lines in green (+).

For the same add following segment into your git config file (.gitconfig) for me this file is at my home location i.e (~/.gitconfig)

    ui = auto
[color "branch"]
    current = cyan blue reverse
    local = blue
    remote = green
[color "diff"]
    meta = blue
    frag = magenta
    old = red
    new = green
[color "status"]
    added = blue
    changed = green
    untracked = magenta

Leave a Reply

Your email address will not be published. Required fields are marked *.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>