git rebase master then push origin branch results in non-fast-forward error

后端 未结 2 734
温柔的废话
温柔的废话 2021-01-02 15:20

I am trying on working on my featureA branch while keeping it up-to-date with the master branch.

Here is the scenario

git clone ssh://xxx/repo

git c         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 15:50

    You can't push after rebasing. The commits now have different SHA1s as their history is different. If the updated ref does not contain the old ref in it's ancestry, it's a potentially harmful operation and git won't allow it.

    Your only alternate is to merge if you don't want to force.

    Forcing is not so bad if you are working alone and don't need to have others committing to this branch.

提交回复
热议问题