How can I find the source branch commit for a feature branch after the branch has been merged?
Consider a git workflow with a master branch and release branches. Master continues forward to the next release. Bug fixes are applied to the release branch, but must be back ported to the master branch.
The feature branch is created on the release branch, reviewed, and merged into the release branch. The feature branch must now be rebased to the master branch to apply the fix to master as well. However,
git rebase --onto master release
Results in 0 commits. This makes sense as release has moved forward and
git merge-base HEAD release
results in HEAD (merge-base being used internally to determine the rebase starting point). Therefore, the rebase results in rebasing nothing. Not useful.
I can use git log to determine where I think the branch point might be, but I'd really like to know better where the branch point is most likely. The goal is better automation for this common situation.
An simple example tree (trees are seldom this simple. :) :
* 5caf21e (release) Merge pull request #689 from ...
|\
| * 9f0f210 Bug 1123: Fix bug
| * bb6b3fa Bug 1123: Reproduce bug
* 077afe0 Merge pull request #688 from ...
|\
| * e750974 (feature/bug1154) Bug 1154: Fix bug
| * 98194b9 Bug 1154: Reproduce bug
* cabb4d2 Merge pull request #681 ...
|\
| * a10c992 Bug 1110: Bug fix
| /
* 7caacee Merge pull request #673 ...
I want to rebase feature/bug1154 at e750974 to the master branch. This branch has been merged and the release branch has moved on as well.
git rebase --onto master release feature/bug1154
results in no commits being applied.
I really want to do
git rebase --onto master cabb4d2 feature/bug1154
How do I find cabb4d2 using git commands? Something that can be automated and easily explained to others, without having to interpret git log by hand.