can't push to branch after rebase

前端 未结 6 608
走了就别回头了
走了就别回头了 2021-01-29 17:28

We use git and have a master branch and developer branches. I need to add a new feature and then rebase the commits to master, then push master to CI server.

The problem

6条回答
  •  暖寄归人
    2021-01-29 18:23

    You need to force the push as you have moved the commits further down the line git is expecting you to add commits to the tip of the branch. git push -f origin myNewFeature will fix your problem.

    Tip: Above is a legitimate usage of force pushing. Never ever rewrite the history on a publicly accessible repository or a lot of people will hate you.

提交回复
热议问题