you are not allowed to push code to protected branches on this project 问题处理

计算机软件/硬件维修 专栏收录该内容
7 篇文章 1 订阅

报错:
在这里插入图片描述

操作结果同上图1-1所示,失败了。

   分析:

   1.git clone下来没有问题,commit本地仓库没有问题,就是推不上去,初步怀疑这个项目的配置有问题(读写权限不一致)。

   2.委托H同学询问其他同事能不能clone下他们的项目,然后提交上去,等待验证结果中。。。。。。



   验证:

   查看错误信息时候,发现酱紫的一句提示:“You are not allowed to push code to protected branches on this project.” ,发现了吗?这个项目的branch类型是“protected branches”!!!

   紧接着,开始逛StackOverFlow,please pay attention:寻找问题的时候,最好的站点是StackOverflow!!!,效率最高的也是StackOverflow。Besides, attach the link:https://stackoverflow.com/questions/32246503/how-to-fix-you-are-not-allowed-to-push-code-to-protected-branches-on-this-proje 。

  睁大眼睛:

  there's no problem - everything works as expected.
  In GitLab some branches can be protected. By default only 'master' user can commit to protected branches. master branch is protected by default - it forces developers to issue merge requests to be validated by project master before integrating them into main code.
  You can turn on and off protection on selected branches in Project Settings (where exactly depends on GitLab version - see instructions below).
  On the same settings page you can also allow developers to push into the protected branches. With this setting on, protection will be limited to rejecting operations requiring git push --force (rebase etc.)

   结合本文第一行的提示,公司新装的gitlab。GitLab一些分支默认被保护,仅仅拥有master级别的用户才能提交到保护分支,而且master分支默认是保护分支,其他用户需要通过合并issue请求来提交上去,靠!找到了。

  Since GitLab 9.0
  Project: "Settings" -> "Repository" -> scroll down to "Protected branches".
  Now you can select who is allowed to merge or push into selected branches (for example: you can turn off pushes to master at all, forcing all changes to branch to be made via Merge Requests). Or you can click "Unprotect" to completely remove protection from branch.

  如图:

  (1)

在这里插入图片描述

     (2)

在这里插入图片描述

  总结:

   1.定位问题是权限问题之后,就该把问题上报了,而且解决方案一并交给组长,是不是有很爽的感觉。

   2.新装的gitLab,master分支默认protectd,这一点很坑啊!!!
  • https://blog.csdn.net/zzh920625/article/details/78087669
  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值