Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log graph showing commits per branch in one place

I searched in StackOverflow and Google but could not find the exact answer, so I would like to ask as a separate question.

Normally we can get the commit graph via git log. I use the following command to see the commit graph in a fancy way.

git log --graph --all --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

The graph I get is as follows:

Results of command

In the log graph, you can see the pointers for all branches, but it is not possible to see which commits are originally created in which branch.

But in Atlassian Fisheye, the log graph has columns showing branches and the commits are located in these columns. You can know the branch of each commit. That is very helpful when you want to track issues during merges and the commits of different branches.

enter image description here

Is there a way to have such a log graph in command line? Is it possible to separate the graph lines by branches as Fisheye does? If that is no way to have it in command line, do you know any client-side application that has "graph by branch" feature as Fisheye does?

like image 814
lemiorhan Avatar asked Nov 14 '13 12:11

lemiorhan


1 Answers

I was searching for exactly the same representation. Most probably this question got outdated but here is how you can do this: use git show-branch.

like image 197
Andreas D. Avatar answered Nov 15 '22 10:11

Andreas D.