Since I could not wait any longer for a thorough solution, I decided to use the cherrypick suggestions. Though, I did not want to go ahead and cherrypick straight on the master
branch, that would be bad practice in my git flow workflow. So I did the following:
Start a new hotfix
$ git flow hotfix start vx.x.x
Cherry-pick the commits from
feature
$ git cherry-pick J^..L
Finish the hotfix, essentially merging the cherry-picked commits into
master
anddevelop
$ git flow hotfix finish vx.x.x
Make sure I never get to merge the commits from the old
feature
branch by deleting them locally and potentially onorigin
.$ git branch -d feature $ git push origin :feature
So, after this, I got the following:
master C --+-- E --+---------- O
| | | | |
hotfix | D --+ J - K - L --+
| | |
develop A - B - C ----- F - G - H - I - M
I'm still convinced I should've been able to solve this somewhat more elegantly with rebase, but I think this did the trick on a marginally elegant way.