I'm looking for a way to determine what git rebase <branchname>
does to get the commit hash that it should be the base. I'm going to use the hash to determine what actually to build in a monorepo.
Heres an example
develop --1--2------5--6-->
\
feature 3--4------->
If from feature
, I do git rebase develop
, Git figures out that I want to base my changes in commit 3 onto 6. It rewinds feature
to 2, plays 5 and 6 from develop
then 3 and 4 from feature
.
How would I find commit 2's hash in this example?