This happens because you're rebasing your changes. Once you've done that your branch no longer contains the same commits as it did before, it contains new commits that reflect the same (or similar changes). When you try to push those changes, git notices that the commit at the current tip of the branch on the target repository isn't an ancestor of the commit which you're trying to set as the new tip of that branch.
You need to use git push -f
to force the push to happen even though it isn't a fast forward. But you when doing this you need to be careful that you're not erasing other changes from that branch. If that branch is only ever modified in your single repository, it should be alright to use -f
on that one branch, but you'll definitely want to be careful to not push to the master
or dev
branch using that flag.