How to force push a reset to remote repository?

后端 未结 10 1845
生来不讨喜
生来不讨喜 2020-11-29 18:49

Our remote master branch somehow got messed up. Current development code is on the master branch along with the latest commits. Obviously, the development code is not ready

10条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 19:16

    You're not allowed to do git push that is not fast-forward.

    1. If the remote is GitHub, go to https://github.com/$USER/$REPO/settings/branches and un-protect the branch in question.

      You have to be admin of the repo to do that.

    2. If the remote is your own git server, run git config receive.denynonfastforwards false there.

提交回复
热议问题