Git git push origin报错解决方法: ! [remote rejected] master -> master (pre-receive hook declined)

augus · 2020-08-19 18:07:38 · 热度: 2.2k

git master 分支回滚到某次提交点后,强推远程master报错:

╰─$ git push -f origin master                                                                                                                             1 ↵
Total 0 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To https://gitlab.xxxx.cn/xxx/xxx/xxx.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://gitlab.xxxx.cn/xxx/xxx/xxx.git'

解决办法:

取消 master 分支的 protected

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册