How to make 'git log' decorate by default

Benubird picture Benubird · Feb 6, 2014 · Viewed 9.7k times · Source

I frequently type git log when what I actually want is git log --decorate. How do I make it decorate by default?

I have seen lots of answers of the form "make an alias lg and then type git lg instead of git log". But, I can't find anywhere how to change the default behaviour of git log itself. alias log does not work.

Answer

Jakub picture Jakub · Feb 6, 2014

git config log.decorate auto

For a global setting, add the --global parameter.

So it would be:

git config --global log.decorate auto

The aliases are made with git config alias.lg "log --decorate"