I have a branch in git and want to figure out from what branch it originally was branched and at what commit.
Github seems to know, since when you do a pull request it usually automatically sets up what branch it should go into, but I can't figure out how to do this manually from the command line.
Let me add a concrete example:
master -- ongoing development
2.2 -- stable maintenance
A feature branch feature
was created (at commit B
below) and worked on (B'
, C'
& E'
) and merged against the source branch to pick up C
and D
feature branch: B'-C'-C--D--E'
/ /
source branch: A--B--C--D--E-- ...
Now I want to merge feature
back into its source, but I am not sure whether it was originally a branch off master
or 2.2
. In order to merge the feature into the correct source, is there a programmatic way to find out if source branch is master
or 2.2
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…