推送Gerrit

时间:2016-06-14 04:35:38

标签: gerrit sourcetree

我想将我的代码推送到Gerrit。我在〜/ .gitconfig

中添加了这些行
[remote "origin"]
url = ssh://hxx@www.xxxx.com:29418/project/cloud
fetch = +refs/heads/*:refs/remotes/origin/*
push = refs/heads/*:refs/for/*

当我推入源代码树时,出现错误:

'git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/refs/for/master 
Pushing to ssh://hxx@www.xxxx.com:29418/project/cloud
remote:
remote: Processing changes: refs: 1
remote: Processing changes: refs: 1, done 
To ssh://hxx@www.xxxx.com:29418/project/cloud
 ! [remote rejected] master -> refs/for/master (prohibited by Gerrit)
error: failed to push some refs to
ssh://hxx@www.xxxx.com:29418/project/cloud

Pushing to ssh://hxx@www.xxxx.com:29418/project/cloud

remote: 

remote: Processing changes: refs: 1  


remote: Processing changes: refs: 1, done 

To ssh://hxx@www.xxxx.com:29418/project/cloud! [remote rejected] master ->

refs/for/master (prohibited by Gerrit)
error: failed to push some refs to ssh://hxx@www.xxxx.com:29418/project/cloud
Completed with errors, see above

似乎我的sourcetree发送了两次push命令。命令也不正确:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/refs/for/master

似乎正确的命令应该是:

 git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin master:refs/for/master 

我的配置错误在哪里?

提前致谢。

1 个答案:

答案 0 :(得分:0)

别担心,“refs / heads / master”和“master”指向同一个提交。这不是问题。期待“to ssh://hxx@www.xxxx.com:29418 / project / cloud![远程拒绝] master - > refs / for / master(Gerrit禁止)”错误信息,好像你做了Gerrit没有权限在此存储库上创建更改。检查你的权限。

相关问题