Benjol Benjol - 1 month ago 10
Git Question

Visualizing branch topology in git

I'm playing with git in isolation on my own machine, and even like that I find it difficult to maintain a mental model of all my branches and commits. I know I can do a

git log
to see the commit history from where I am, but is there a way to see the entire branch topography, something like these ascii maps that seem to be used everywhere for explaining branches?

/ / / / /
\ / / / /

It just feels like someone coming along and trying to pick up my repository would have difficulty working out exactly what was going on.

I guess I'm influenced by AccuRev's stream browser...


git log --graph or gitk. (Both also accept --all, which will show all the branches instead of just the current one.)

Edit: For branch names and a compact view, try: git log --graph --decorate --oneline