zl程序教程

您现在的位置是:首页 >  其他

当前栏目

git报错You are not allowed to force push code to a protected branch on this project

OncodeGit 报错 to not this project
2023-09-14 09:07:44 时间

当我们有时候回滚了代码,想强制push到远程仓库的时候,

git push origin --force

会报如下错误:

You are not allowed to force push code to a protected branch on this project

如果用的是gitlab版本库,这说明gitlab对仓库启用了保护,需要在仓库中设置一下:

"Settings" -> "Repository" -> scroll down to "Protected branches".

参考链接:在这里