[SOLVED] How to Color Git using Ubuntu Terminal?

Zyxware default image4

When you want to change from the black and white colors in your git, you can use the default git color configurations using the command:

git config --global color.ui true

The --global is optional, if you want to make the coloring for the current repository, ignore this and type it as:

git config color.ui true

To make it more colorful you can add more configurations in your .gitconfig file. By default, git supports the colors black, red, green, yellow, blue, magenta, cyan and white. To add configurations by yourself, open the Ubuntu terminal and type the command to open git configuration file. Here I have used the vi editor, so you type,

vi ~/.gitconfig

Add the following configurations to the file and save.

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

This way you can change the colors of your git status, diff etc as your own idea and make your git beautiful. Have fun and happy coding.