git推送master分支失败

连上远程库后,尝试做一个推送

>git push -u origin master

git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 188 bytes | 188.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To code.aliyun.com:xxxx/xxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘git@code.aliyun.com:xxxx/xxx.git’

原因: GitLab一些分支默认被保护,仅仅拥有master级别的用户才能提交到保护分支,而且master分支默认是保护分支,其他用户需要通过合并issue请求来提交上去

让同事在阿里code上将我的帐号设置为owner组内后,再次提交,可以完成

ref: https://blog.csdn.net/zzh920625/article/details/78087669

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注