If you branched from master
and are now on experiment
, then stay on experiment
and say
git log master..
Example on my machine. First, actual situation:
% git log --all --oneline --graph
* 5368511 (HEAD -> experiment) z
* 7f0990f y
* 5c7d1be x
| * d0d5a50 (master) c
| * 47a21c4 b
|/
* 4dcb110 a
And then we say:
% git log --graph --oneline master..
* 5368511 (HEAD -> experiment) z
* 7f0990f y
* 5c7d1be x
But this does not meet the requirement that you don't want to have to work out what branch you branched from. It is actually quite hard to discover that, because Git has no concept of "branched from". We just did a big discussion of that here:
git: diff between current branch and branch creation
You can see it's exactly the same issue: if you know what branch you "branched from", this is easy. If you don't, not so much.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…