A better Git Log

I this short post we gonna learn how we can enhance the git log experience with 2 updates:

  1. Using git log statement with params to see the log in a more visible way.

  2. By adding a alias to our git context.

  3. The git log enhanced version:

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

This will show the messages in a pretty neat format.

  1. By adding an alias to our git context.

To add the alias like git lg or git l using this log statement, you need to run:

To use git lg

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"

To use git l

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

Happy Coding!