git push报错:you are not allowed to push ...

快乐鱼儿 1年前 ⋅ 1890 阅读

git push报错:you are not allowed to push code to protected branches on this project

场景:

本地修改需要退回到之前的版本,打算强制push本地版本覆盖远程版本,但是在git push --force后出现了以下的错误:
Fix GitLab error: “you are not allowed to push code to protected branches on this project”?

问题原因:
原来gitlab对应的分支进行分支保护设置。

解决方法:
"Settings" -> "Repository" -> scroll down to "Protected branches" 改成unprotected就好。

如图:


全部评论: 0

    我有话说: