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

Can't push local repo to private repo on bitbucket with Sourcetree Mac

Dave Davis February 14, 2016

Sourcetree and Bitbucket are making me lost my mind: I can't successfully push files to a Bitbucket repo using Sourcetree (but I'm successfully pushing/pulling from github, which is odd since it's  not made by atlassian).

I presume my problem is permissions based. I've attempted and failed repeatedly trying to set up and select clone on bitbucket, copy/paste address for SSH and HTTPS access to the repo into sourcetree.

SSH fails whether I place my SSH keys at the account level or at the repo level in Bitbucket (I have one key, it will only let me put it on the account or the repo, but not both; when I attempt to add it again it warns the keys are in use at the other level – makes no sense since the idea is to identify users thus only one set should be required, or either should work... they do on GIT, but not bitbucket).

HTTPS requires me to remove the keys to work at all, but when I do I get this odd message: "I don't handle protocol 'git clone https' "  I attempted typing the https string in manually, as I saw on Stack that the paste sticks a unicode character in there. No love.

C'mon, this can't possibly be so hard! It definitely isn't with git. I need a private repo, and am paying at github for what's theoretically free on bitbucket, but it doesn't work at all. Is this a case of "get what you pay for" or am I doing something wrong here? Apparently this is a common problem, which no one is inclined to answer:
https://answers.atlassian.com/questions/100257.

https://answers.atlassian.com/questions/12158469

https://answers.atlassian.com/questions/32015697

https://answers.atlassian.com/questions/13417039

Tried so far:

Instructions at: https://answers.atlassian.com/questions/153092

Yields error: " Pushing to git@bitbucket.org:musicliteam/musicli-local-dev.git Permission denied (publickey).

fatal: Could not read from remote repository. "
But there are no public keys! So I presume this method relies on SSH.

What's the simplest way to push a local repo to Bitbucket using Sourcetree on a mac? I've followed every instruction and tutorial I've found to the letter. This seems impossible.

4 answers

2 votes
cdbowen August 19, 2017

I came across this issue too. I used SourceTree on my Mac to manage the SSH identities, and it didn't work. I solved it by following the solution here. Short summary:

From a terminal window:

> ssh-add -l

This will probably display "The agent has no identities.".

In which case, run the following at the terminal prompt:

> ssh-add

This will add your existing ssh RSA identity. If no keys were found, check the contents of the ~/.ssh directory to see of you have an id_rsa.pub file. If not, then run the following:

> ssh-keygen

and then run ssh-add again. Now, you need to copy the id_rsa.pub file contents to the clipboard:

> cat ~/.ssh/id_rsa.pub | pbcopy

Next, tell BitBucket about it. Go to the settings of your BitBucket account. Under Security, choose SSH Keys and then add a SSH key. Give the new key a name (not so important), and paste in the key copied into the clipboard. It should start with "id_rsa". Save the key.

SourceTree should now work.

0 votes
Holzer Stefan November 1, 2016

same issue here. I just get an error message with no response from the server which is : "Creation of the repo failed. the error which came from the server is:" 

I presume my problem is permissions based as well but not sure what to do from here. I can see all my remote repos in SourceTree and I'm able to clone them but creating one is like publishing not possible.

0 votes
lihr October 20, 2016

Same happening here. Bitbucket switched from usernames to email addresses and my dev process is totally broken. Refuse to go command line. Such a great job on the software til now but damn. This is NOT fun.

0 votes
Dave Davis February 23, 2016

Help? Still an issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events