DEV Community

loading...
Cover image for Pretty git log

Pretty git log

tuanluong19 profile image Tuan Luong ・1 min read

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

Discussion (0)

pic
Editor guide