Shaun Luttin Shaun Luttin -4 years ago 161
Git Question

Git log graph, display how two branches are diverging

We would like to view a graph of how two branches are diverging. Running

git log --oneline --graph
displays only the current branch. How do we include both branches in the graph?

Answer Source

git log takes zero or more commits as arguments, showing the history leading up to that commit. When no argument is given, HEAD is assumed. For your case, you want to supply the two branch heads you want to compare:

git log --graph --oneline currentbranch otherbranch

If it doesn't display too much, you can simplify this by using

git log --graph --oneline --all

which acts as if you had specified every reference in .git/refs as the commits to display.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download