git

Visualize Git Branch Tree

serhatteker

Serhat Teker

Posted on April 19, 2021

Visualize Git Branch Tree

We saw how we can visualize our commits with tree-like graph in the post Visualize Git Log Tree.

git visualize log tree

Okay but sometimes I only need branch names, since I create and add bunch of feature or fixing bugs — a.k.a another feature. Therefore I want to know which branch is the up-to-date one or where this branch comes from. I
wanna see the branch relations.

Luckily we have a log format for that:



$ git log --graph --simplify-by-decoration --pretty=format:'%d' --all


Enter fullscreen mode Exit fullscreen mode

It will show branch tree like below:

git branch visualize

Alias

An alias will be useful for this command since I'm gonna use it a lot.



alias glb='git log --graph --simplify-by-decoration --pretty=format:'%d' --all'


Enter fullscreen mode Exit fullscreen mode

All done!

💖 💪 🙅 🚩
serhatteker
Serhat Teker

Posted on April 19, 2021

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

Sign up to receive the latest update from our blog.

Related