Git Diff Colours By Default

If you want to make git-diff use colours by default, try running this little command:

echo '[color]
 branch = auto
 diff = auto
 status = auto
[color "branch"]
 current = yellow reverse
 local = yellow
 remote = green
[color "diff"]
 meta = yellow bold
 frag = magenta bold
 old = red
 new = cyan
[color "status"]
 added = yellow
 changed = green
 untracked = cyan' >> ~/.gitconfig

Simply copy and paste the above to your command line and hit return.

Then if you run:

git diff master..BRANCH

You will get a nice coloured display


Tags: gitcolorcolourshellbashtipdiffconfig