0

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?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • 1
    Possible duplicate of [Git: Find the most recent common ancestor of two branches](https://stackoverflow.com/questions/1549146/git-find-the-most-recent-common-ancestor-of-two-branches) – jonrsharpe Sep 12 '19 at 13:27

1 Answers1

0

Have a look at git merge-base

$ git merge-base develop feature
Hans
  • 121
  • 2
  • 7