欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

gitpush代码报错

程序员文章站 2022-03-08 12:00:47
...
$ git push origin mybranch-0001
Counting objects: 3, done.
Writing objects: 100% (3/3), 215 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To https://github.com/bytedance/nnproxy
 ! [remote rejected] mybranch-0001 -> mybranch-0001 (pre-receive hook declined)
error: failed to push some refs to 'http://git.foo.com/xjbl/foo.git'

有一种可能是developer角色没有往默认分支提交代码的权限,导致被rejected。需要master角色在新工程里面创建一个默认的master分支之后,developer就可以创建其他分支,提交代码并可以合并代码到master主分支上。
相关标签: git push rejected