Where developers come to connect, share, build and be inspired.

1125

A better git log

175702 views

So, are you tired of this old and bored git log screen?

Picture

How about this one, instead?

Picture

It's simple. Just type in:

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

And every time you need to see your log, just type in

git lg

Or, if you want to see the lines that changed

git lg -p

Picture

Hope you like it :)

PS: It seems that there's no way to view larger images, so I've linked bigger versions of them on the tip. Just click the image. Thanks to @basus(http://www.twitter.com/basus) for the note

Update: As some people were reporting, the git lg -p command wasn't working. As pointed out by the user universal_property at reddit, removing the -- at the end made it work.

Comments

Add a comment