【错误解决】git报错: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就好。

如图:
【错误解决】git报错:you are not allowed to push code to protected branches on this project

参考来源:
https://*.com/questions/32246503/fix-gitlab-error-you-are-not-allowed-to-push-code-to-protected-branches-on-thi

上一篇:docker中的镜像中运行Django项目


下一篇:CLI报错:error More than 1 blank line not allowed