Pretty git log with colors and graphs

I work with git in console pretty often. Commits, pulls, pushes, checking out branches, diffs — I do all that stuff. Of course, more complicated operations, like merge, I perform with GUI tools (IntelliJ IDEA is pretty good for that). Sometimes it's pretty useful to be able to check history log in a readable view without switching from console to some other program.

I configured an alias for pretty git log output with colors, dates, branches, etc. Since sometimes there is a case when I need to restore that config setting (e.g. when I move to another computer), I decided to put it into public. Maybe it'll be useful for someone besides me.

So, here it is:

[alias]
	lg = log --graph --all --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ad)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=local

This code should be placed in .gitconfig file (usually it's located under a home folder if you are using Linux). Note, that the above alias will also work on windows.

With that setting in place, you can just type git lg in console and you'll get a nice tree of commits!