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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…