Byte Friendly

Random thoughts on programming and related topics.

Pretty Log in Git

| Comments

Here’s what default git log output looks like

While it is sure contains the information and is easily parsable by a machine, it’s not the best way to present it to a human. Luckily, the git log commands is quite customizable. Try this, for example:

git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

You can even set make an alias for it:

git config --global --add alias.plog "log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"

And then you just call

git plog

Happy gitting!

Comments