Git alias, color and pretty printing

I’m tired of looking at the plain old log in git, so let’s see how we can spice it up a bit?

If you ever needed to have a prettier format of printing the git log, for easier changes, you can add this to the alias section of the .gitconfig file.

log-color = log --graph --full-history --all --color --pretty=format:'%x1b[31m%h%x09%x1b[32m %C(white)- %d%x1b[0m%x20%s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --date=relative

So after you add this line to the alias section executing git log-color on a git repo directory will give you the following output.

In our case for the node git repo:

git log color screenshot 1
git log color screenshot 2