I've already looked at questions
git rebase and git push: non-fast forward, why use?
and
master branch and 'origin/master' have diverged, how to 'undiverge' branches'?
I'm still not clear on what I need to do in this specific case. I had origin/master and master in sync first. The sequence of commits on both is
---o---A---B
I now commit two more commits on my local repository so that I have
---o---A---B---C---D
Now I did a rebase because I wanted to reorder the commits. So my master is now :-
---o---A---C---D---B
while my origin/master is still as it was in the first situation. Now, if I try to do a git push, it refuses to push it because master and origin/master have diverged. How do I push this rebase to origin?