Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Sourcetree - Error when pushing to Git

I am trying to get sourcetree to push a change into Git (well, Gerrit actually). From the GIT command line I am able to clone the repo, and also push using a command of the form:

  git push ssh://username@mygithost:29418/reponame.git HEAD:refs/for/master

However, if I attempt to push using Sourcetree, an error occurs (see below). I assume that since this work from the command line that there must something I have not configured properly in sourcetree?

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/refs/for/master 
Pushing to ssh://username@mygithost:29418/reponame.git
remote: 
remote: Processing changes: refs: 1        
remote: Processing changes: refs: 1, done            
Tossh://username@mygithost:29418/reponame.git
 = [up to date]      1.0.0 -> 1.0.0
 = [up to date]      1.1.0 -> 1.1.0
 = [up to date]      1.1.1 -> 1.1.1
 = [up to date]      1.1.2 -> 1.1.2
 = [up to date]      1.1.3 -> 1.1.3
 = [up to date]      1.1.4 -> 1.1.4
 = [up to date]      1.1.5 -> 1.1.5
 ! [remote rejected] master -> refs/for/master (prohibited by Gerrit)
error: failed to push some refs to 'ssh://username@mygithost:29418/reponame.git'
Completed with errors, see above

4 answers

I  am  the same error.  I can push my content success   ,but it  show the same error

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 08, 2015

After succeeding (with 0 changes) for all other branches, the error message says "[remote rejected] master -> refs/for/master (prohibited by Gerrit)"

=> It is Gerrit stopping your push, not SourceTree. Do you have sufficient rights to push to master?

I assume that I do have push rights, as I am able to push to the same repo using the git command line, as follows: git push ssh://username@mygithost:29418/reponame.git HEAD:refs/for/master

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 12, 2015

Does SourceTree use a different SSH agent? Is it running? Do you perhaps have multiple keys?

Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 13, 2015

Yeah, it seems like SourceTree is using a different SSH key than is the command line, and that it's for an account for which you have permission on the other branches but not the master branch (whereas whatever SSH key the command line is using has permission on all branches). That's the only thing I can think of. That's why I asked whether it was a Mac or a PC, because I've seen this before on a PC where there in't built-in support for SSH so its easier to accidentally set up multiple keys. But I'd go to your ~/.ssh folder and see what keys you have set up there and compare that with what's configured on Gerrit.

I checked my ~/.ssh folder. There is only one key in there. I will check that with what I have in gerrit to see if there is any difference.

It seems that this is a bug in sourcetree 2.0.5. See: https://jira.atlassian.com/browse/SRCTREE-2940

I am using a Mac.

0 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 02, 2015

Are you on a Mac or a PC? It seems like maybe your SSH isn't working

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events