Nicer git log

25 Apr 2017
Home

Muffin Man's writings

This article will take less than 1 minute to read.
No comments

Just a short one. I want to share a simple command to display nicer git log in the terminal. git log has --pretty=format option built-in, we are just going to pass formatting to it.

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

And it looks like this:

Nicer git log

Then add it to your .bash_profile as an alias (I’m using glog) and that’s it.

alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
Share on
Categories
Development Bash

No comments, be the first to comment

Sending failed, please try again.
Thank you! Your comment is sent. Please note that all of the comments go through moderation.