admin管理员组文章数量:1530013
更新代码的时候出现:
具体操作步骤:
- git remote update
- git rebase origin name
出现如下:
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 8.02 KiB | 0 bytes/s, done.
Total 8 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6)
remote: Branch refs/heads/sense:
remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.
remote: User: xxx
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done
To ssh://xxx/xxx
! [remote rejected] xxx -> xxx (prohibited by Gerrit)
error: failed to push some refs to 'ssh://xxx/xxx'
解决方案
遇到该问题的时候,百思不得其解,命名昨天还是好的,今天怎么会这样,反复思考之后,返现我昨天遇到编译错误,删除了仓库,重新从服务器拉取了最新分支,找到问题的突破口,解决步骤:
- 首先查看代码目录下的 .git / config 配置文件
[core]
repositoryformatversion = 0
filemode = true
[remote "demo"]
url = ssh:xxx
review = review.source.android
projectname = buildroot
fetch = +refs/heads/*:refs/remotes/xxx/*
[branch "sense"]
remote = xxx
merge = xxx
可以发现[remote “demo”]只有获取代码的权限,没有push代码的权限,导致push 报错 ,
服务器的代码主要是由Geriit+Git+Repo 构成版本及审核机制,重新回忆下拉取代码的流程,发现过程中少了一步建立Gerrit 审核代码的机制 ,执行之后,可以正常提交
repo forall -c 'git config remote.xxx.push refs/heads/*:refs/for/*'
正常的 .git/config 文件配置
[core]
repositoryformatversion = 0
filemode = true
[remote "demo"]
url = ssh:xxx
review = review.source.android
projectname = buildroot
fetch = +refs/heads/*:refs/remotes/xxx/*
push = refs/heads/*:refs/for/*
[branch "sense"]
remote = xxx
merge = xxx
本文标签: pushGitreadadministrator
版权声明:本文标题:[ Git篇 ] git pushPlease read the documentation and contact an administrator 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1726641422a1079687.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论