remote: GitLab: You are not allowed to push code to protected branches on this project.

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了remote: GitLab: You are not allowed to push code to protected branches on this project.相关的知识,希望对你有一定的参考价值。

参考技术A 错误日志如下:

运维那边加了钩子,merge 提交被拒,因为不符合分支合并规范;解决方案如下:
随便找个文件加个空格,保存,然后:

之所以可以这么做的原因是,运维小伙伴那边提前约定了指定 commit msg 开头,当检测到以‘ FIX_MERGE_ERROR’开头,则放行,不走钩子检测;所以,当运维小伙伴的设置规则不是 FIX_MERGE_ERROR 的话,其实这个方法没用,就得找运维同学问下了。(当然,大多数公司是以‘ FIX_MERGE_ERROR’开头的,可以直接碰碰运气)

GitLab: You are not allowed to push code to this project.

产生:

在提交项目时,发现一直提示没有被允许提交代码。

$ git push origin master
> GitLab: You are not allowed to push code to this project.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


原因:

在git上建项目的时候,你只有访客的权限(可以克隆,查看项目),但是不可以提交代码的。如下图:

解决办法:

让项目的管理员或者创建者将你的权限修改成Maintainer

以上是关于remote: GitLab: You are not allowed to push code to protected branches on this project.的主要内容,如果未能解决你的问题,请参考以下文章

remote: GitLab: You are not allowed to push code to protected branches on this project.

git合并分支成功,但是push失败(remote: GitLab: You are not allowed to push code to protected branches on this pr

Gitlab提交代码:You are not allowed to push code to this project.fatal: unable to access requested URL

Gitlab提交代码:You are not allowed to push code to this project.fatal: unable to access requested URL

GitLab: You are not allowed to push code to this project.

GitLab: You are not allowed to push code to this project.