0

I'd like to push my code to Gerrit. I added these lines in my ~/.gitconfig

[remote "origin"]
url = ssh://hxx@www.xxxx.com:29418/project/cloud
fetch = +refs/heads/*:refs/remotes/origin/*
push = refs/heads/*:refs/for/*

When I push in my source tree, I got error:

'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

It seems my sourcetree send push command twice. also the command is incorrect:

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

It seems the correct command should be:

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

where is my mistake in my configuration?

Thanks in advance.

user3034559
  • 1,259
  • 2
  • 15
  • 31

1 Answers1

0

Don't worry, "refs/heads/master" and "master" points to the same commit. This is not the issue. Looking to the "To ssh://hxx@www.xxxx.com:29418/project/cloud! [remote rejected] master ->refs/for/master (prohibited by Gerrit)" error message, it seems that you do not have permission in Gerrit to create changes on this repository. Check your permissions.

  • This is a issue for sourcetree.https://jira.atlassian.com/browse/SRCTREE-2940, I have permission for this project. – user3034559 Jun 15 '16 at 03:17