can't push to branch after rebase

前端 未结 6 654
走了就别回头了
走了就别回头了 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:20

    You need to perform a forced push, i.e. git push -f origin myNewFeature

    Oh, and you better make damn sure that people don't base anything on your dev branch - usually you aren't supposed to publish branches where you are rewriting history at all (or rather do not rewrite history once published). One way would be using a branch name like wip/myNewFeature and then mentioning that wip branches will be rebased to master from time to time.

提交回复
热议问题