Based on comments, it seems as though I misread your question regarding what commit 92dd09b
identifies. I've kept my original answer below to avoid making the comment conversations even more confusing. But based on my current understanding, you really have
... x
\
x -- x -- x -- A -- 92dd09b -- x -- M2 -- x <--(develop)
/
... x -- B <--(branch)
In that case, what you tried first (checkout 92dd09b
, run git log) should show the commits from both branches; you could exclude the commits from the "merged in" branch by saying
git log --first-parent
Or, per phd's answer, you could say
git show 92dd09b~
(among other things).
Your comments indicate that this didn't get you to the right commit, though, which suggests that something is incorrectly observed.
So as I understand the question you had a develop branch
x -- x -- x -- A <--(develop)
and you had another branch
x -- x -- x -- A <--(develop)
... x -- 92dd09b <--(branch)
and you merged 92dd09b
into develop
x -- x -- x -- A -- M1 <--(develop)
/
... x -- 92dd09b <--(branch)
and now maybe some more work has happened
... x
\
x -- x -- x -- A -- M1 -- x -- M2 -- x <--(develop)
/
... x -- 92dd09b <--(branch)
So now you want to find A
.
As a rule, commits make it easy to look "back in time"; less easy to look forward. If you start from 92dd09b
, you have to "look forward" to get to M1
, and then look back at A
.
So it's not as easy as you might hope. But it can be done. You could start with
git log --merges --format=%p develop
This will give you parent lists for each merge commit in develop
, one on each line. So then you can filter that in any number of ways.
git log --merges --format=%p develop |grep 92dd09b$ |cut -d" " -f1
should print the abbreviated hash of the "other" parent of M1
, which should be A
. (Assuming it's not an octopus merge, and assuming you merged 92dd09b into develop
and not the other way around.)