2016-06-14 51 views
0

我想将我的代码推送到Gerrit。我在添加这些行我的〜/的.gitconfigGerrit禁止的gerrit命令错误

[remote "origin"] 
url = ssh://[email protected]: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://[email protected]:29418/project/cloud 
remote: 
remote: Processing changes: refs: 1 
remote: Processing changes: refs: 1, done 
To ssh://[email protected]:29418/project/cloud 
! [remote rejected] master -> refs/for/master (prohibited by Gerrit) 
error: failed to push some refs to 
ssh://[email protected]:29418/project/cloud 

Pushing to ssh://[email protected]:29418/project/cloud 

remote: 

remote: Processing changes: refs: 1 


remote: Processing changes: refs: 1, done 

To ssh://[email protected]:29418/project/cloud! [remote rejected] master ->

refs/for/master (prohibited by Gerrit) 
error: failed to push some refs to ssh://[email protected]:29418/project/cloud 
Completed with errors, see above 

看来我sourcetree发送推送命令两次。还命令是不正确:

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 

哪里是我的错,我的配置?

在此先感谢。

+0

看来sourcetree在我的命令中添加了refs/heads。我怎样才能在我的命令中删除这个前缀? – user3034559

回答

0

别担心,“refs/heads/master”和“master”指向相同的提交。这不是问题。寻找到“ssh://[email protected]:29418/project/cloud![remote rejected] master - > refs/for/master(Gerrit禁止)”的错误信息,似乎你没有在Gerrit有权在这个存储库上创建更改。检查您的权限。

+0

这是sourcetree.https://jira.atlassian.com/browse/SRCTREE-2940的问题,我有此项目的权限。 – user3034559