I'm working on the the feature branch called auth
, which was branched out from master
branch:
C1 (master)
\
C2-C3 (auth)
After I've made C3
commit, I pushed the auth
branch to remote for backup. Then master
branch is updated on remote and the history looks like this:
C1-C4 (master)
\
C2-C3 (auth)
I'm rebasing auth
branch to updated master
branch and the history now looks like this:
C1-C4 (master)
\
C2-C3 (auth)
Then I make more changes on auth
branch, make C5
commit and push auth
branch to remote and the push is rejected with the message that there are updates on remote that I don't have locally. But I know that no one else pushed to the auth
branch on remote. So why is this behavior?
This article provides just a simple explanation for such behavior:
Beware though: if the rebased branch had been pushed to a remote (for backup purposes, for instance), you’ll need to force the next push of it with the -f option, as you just replaced its commit history with a fresh one.`