Git log graph showing commits per branch in one place
Asked Answered
S

2

6

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?

Sybil answered 14/11, 2013 at 12:28 Comment(1)
Hey, your command has some spaces in the --abbrev-c ommit flag. Would you mind removing them? I got here trying to find that command, I apparently wasn't bright enough to put an alias in my dotfiles last time I had it.Parsimony
P
1

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.

Plutocrat answered 18/11, 2015 at 14:43 Comment(0)
R
0

Regarding the "client-side application that has "graph by branch" feature" info request, Have you tried Atlassain's Sourcetree? It has the ability to display all branches in your repo or just the current branch that you are currently on. It could be used as a way of identifying what branch a commit originated on via its GUI.

Romaineromains answered 10/12, 2014 at 13:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.