DEV Community

Serhat Teker
Serhat Teker

Posted on • Originally published at tech.serhatteker.com on

Visualize Git Log Tree

The git log is a powerful command which shows commit history.

$ git log
Enter fullscreen mode Exit fullscreen mode

git log

However since I am a more visual thinking person I need some visually appealing form to see my commits.

Tree

Here is the solution for my need:

$ git log --oneline --decorate --graph --all
Enter fullscreen mode Exit fullscreen mode

which will give the format like below:

git log

Absolutely easier to grasp what is going on with the history.

Tree with date and author

If you also want to see date and author use this:

$ git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --all
Enter fullscreen mode Exit fullscreen mode

The output:

git log

Aliases

It will be beneficial to use aliases for them:

alias glt='git log --oneline --decorate --graph --all'
alias glta='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --all'
Enter fullscreen mode Exit fullscreen mode

All done!

Top comments (0)