git log graph all
I’m playing around with git and seeing how it’s internal works in
preparation for an upcoming talk.
source
One thing I discovered: git can display its log as a graph with
command: $ git log --graph
When used on a single branch, this is the output:
Which is nice, and does not show anything more than the $ git log
command:
Adding $ git log --graph
with the --all
command produces something
a little more interesting:
There are indicators of where different branches start to diverge.
- commit:
c02bd
is the master branch.
- commit:
c2a5c
is the testing branch, which is not on the master
branch.
- commit:
41981
is the merge_testing branch, which is a combination
of the master branch and testing branch.
- commit:
0490c
is the rebase_testing branch, which is a direct
descendant of the testing branch.
Combining with --oneline
Conclusion
git log --graph --all
produces a nifty graph on the command-line to
visualize the current state of the repository and all the branches.