Right now, when I type “git branch”
it lists my branches in an arbitrary order.
What I would prefer would be if “git branch” listed my output in a tree like fasion, somethign like:
master
|-- foo
|-- foo1
|-- foo2
|-- bar
|-- bar4
Where here, foo & bar were branched from master; foo1 & foo2 were branched from foo; bar4 was branched from bar.
Is this easy to accomplish?
[Command line utilities only. This needs to fit into my zsh/vim workflow.]
The answer below uses
git log:I mentioned a similar approach in 2009 with “Unable to show a Git tree in terminal“:
But the full one I have been using is in “How to display the tag name and branch name using git log –graph” (2011):
Original answer (2010)
git show-branch --listcomes close of what you are looking for (with the topo order)But the tool git wtf can help too. Example: