error: failed to push some refs to ‘git@xxx.git‘

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: failed to push some refs to ‘git@xxx.git‘相关的知识,希望对你有一定的参考价值。

【问题描述】:通过 git push -u origin master 提交代码时出现如下报错:

##git push -u origin master
Enumerating objects: 96, done.
Counting objects: 100% (96/96), done.
Delta compression using up to 4 threads
Compressing objects: 100% (74/74), done.
Writing objects: 100% (74/74), 93.61 KiB | 3.23 MiB/s, done.
Total 74 (delta 33), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To git.bd.com:new/bd.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘[email protected]:new/bd.git‘

【排查分析】:语法没有问题,是提交到指定的分支,与以往没有不同
因为项目账号删除,即没有owner,而当前提交人员为developer,所以报错。
【解决方案】: 添加项目的owner,再次提交即可。

以上是关于error: failed to push some refs to ‘git@xxx.git‘的主要内容,如果未能解决你的问题,请参考以下文章

Git上传提示error: failed to push some refs to

error: failed to push some refs to

git 错误error: failed to push some refs to

git常见错误:error: failed to push some refs to 'xxx'

git push error: ! [rejected] failed to push some refs to . . .

Git push 报错 "error: failed to push some refs to " 解决