As a developer on php-src I recently find myself in the following situation:
A B C
o---o---o version1
\
o---o-----o---o master
x y D E
o---o---o upstream/master
x y z
So when I do git push --dry-run upstream master version1
I get the typical:
! [rejected] master -> master (fetch first)
My natural response is to rebase the affected branch and preserve merge commits:
git fetch upstream
git rebase -p upstream/master
It's important to note that the original merge commit wasn't trivial, because there are so many changes between the version branch and the master; it takes an effort to resolve such a merge.
Doing the above rebase operation causes a merge conflict and I have to resolve it again; this is almost exactly the same job that I had already done.
Is there a better way to do this? Or did I forget an obvious rebase option?