DEV Community

Cover image for Pretty git log
Tuan Luong
Tuan Luong

Posted on

Pretty git log

If you are seeing that default git log is not visual and hard to read. You can try to do some customizes by using --graph and --pretty.

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

Or shorter with alias

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"
Enter fullscreen mode Exit fullscreen mode

Finally

git lg
Enter fullscreen mode Exit fullscreen mode

Let try to update colors as you like.
Happy coding!

Source: https://coderwall.com/p/euwpig/a-better-git-log

Top comments (0)