Pretty Git log

Are you tired of boring log showed by git log command like below?


Yeah, me too! Lets make a better git log right now which actually makes sense. To get a sneak peak about what we’ll achieve, run this command on your terminal:

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


You’ll get something like this:


I know its too big! Lets make an alias then. Just run this 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"


From now on, you can simply write git lg to get this pretty log every time. You can even see the lines that changed. Just type in git lg -p and you’ll get something like this:


Hope you’ll ❤ this!

Leave a Reply

Your email address will not be published. Required fields are marked *