我想将我的代码推送到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
哪里是我的错,我的配置?
在此先感谢。
看来sourcetree在我的命令中添加了refs/heads。我怎样才能在我的命令中删除这个前缀? – user3034559