git

Visualize Git Log Tree

serhatteker

Serhat Teker

Posted on April 12, 2021

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!

πŸ’– πŸ’ͺ πŸ™… 🚩
serhatteker
Serhat Teker

Posted on April 12, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related