Error in pushing branch after git rebase

I am new to Git. I have cut my branch from master as follows:

git co master
git fetch
git pull origin master
git co -b my_branch

Now I have been working on my that branch for past one week. Now it is ready to be deployed. So I did

git rebase master

But after rebasing while I am trying to push my branch, it keeps giving error saying I have to pull first. I finally pushed my branch as follows:

git push -f origin my_branch

I alone working on this branch. So every code on this branch has been pushed by me only. Then how it's giving such error, I don't understand. Please help.


Using git-rebase imply rewriting commits. Since commits have changed, git push can't do a fast-forward anymore, so you have to force it.

You can take a look at that possible duplicate for further explanation: Git push rejected after feature branch rebase

链接地址: http://www.djcxy.com/p/49244.html

上一篇: pull rebase后Git推分支错误

下一篇: 在git rebase之后推送分支时出错