Find Questions…

Close ×
First time here? Check out the FAQ!

ssh on github and bitbucket using sourcetree

Aaron asked this question · 1 karma ·

I have created two ssh identietes and added it to my account when I do ssh-add -l I see two identities. I have a work account linked to one identity and a peresonal account linked to the other account.

When i try to clone a repository on bitbucket I see an error that says "this is not a valid source path/URL" even though it exists.

When I try to clone a repository on github I see a pop up message that says "gethub API call failed" and then provides me some kind of HTML dump of a website that looks like a 404 since the title is <title>404</title>.

I am wondering if this is a bug, or if I have somehow messed up my configuration. I followed the steps on the documentation and it seems to work.

Thanks!

4651 views

One Answer:

Steve Streeting [Atlassian] · 14,675 karma ·

These are actually two different problems.

The GitHub one is easy - they turned off the API that the Hosted Projects view was using on Tuesday. I managed to get a fix out for that within 2 hours but if you're using the Mac App Store version you'll have to either wait until Apple approve it, or (a better option) download SourceTree direct from our website instead (http://sourcetreeapp.com). Note that you can still actually clone from GitHub regardless, you'd just have to copy/paste the clone URL into the clone repo dialog yourself, instead of the Hosted Projects view giving it to you.

The SSH access to Bitbucket is something else. Please make sure you've added your SSH public key to your Bitbucket account, and if you're sure this is set up correctly and the URL is right, please click on the 'Details' button next to the "this is not a valid source path/URL" message and tell me what the contents say.

Aaron · 1 karma ·

Let me update to the sourcetreeapp version and then I will post again if I am having any problems.

Thanks!

Aaron · 1 karma ·

So, looks like the github stuff is workkng great now! Thanks for pointing me to the latest version. I guess I'll just use that from now on.

On bitbucket; not so successful. I have two identities one with a pub key that ends in b6:06 and one that ends in 20:45. I have created two ssh keys and checked that they exist when i do ssh-add -l (on Mac 10.7.4).

The 20:45 account is the administrator of a group. In SourceTree I have added both bitbucket accounts and made sure that ssh protocol is selected. In the bookmarks window I click on the hosted repos button and see a list of all repos owned by my b6:06 and all repos owned by the group that 20:45 is the administrator of. When I click on any repo from 20:45 it attempts to connect to either git@bitbucket.org:groupname/reponame.git or ssh://hg@bitbucket.org/groupname/reponame (depending on the repo type) and then I get the "This is not a valid source path / URL error and the following details:

I have made sure that the pub key is saved on my https://bitbucket.org/account/user/username/ssh-keys/ page.

Now the funny thing is that if I connect to any repo that b6:06 owns then there is not problems. So I thought that maybe my ssh key needed to be saved at https://bitbucket.org/account/user/groupname/ssh-keys/ but I tested it that way and it still didnt work.

Any insight would be super helpful.

Thanks!

Steve Streeting [Atlassian] · 14,675 karma ·

Thanks for the detail. So I think the issue is that ssh is trying the first key only, and that's failing for the repositories that have to be accessed by the other key. Is there any reason you just don't use a single key?

If you need to use two keys, you're going to have to add some ssh rules to make this work. This could get quite fiddly because although it's pretty easy to specify which ssh key to use per host, if you use different keys on the same host for different paths, you start having to update the configuration for every repo you create / use. Therefore I really recommend that you use a single key instead.

If the reason for having 2 keys is that you don't want to have universal access to administer repos, then a simpler option might be to create another user on your mac for the admin operations, which has that admin key in its ssh configuration. Mac OS X Lion now has the ability to fast-switch between users without logging out the current user so it's actually pretty convenient to use this setup.

HTH

Aaron · 1 karma ·

I would use one key but bitbucket does not let me enter in the same key for both accounts. It says the key is already in use. If this feature was added to bitbucket then that would be a nice fix.

I don't want to go into detailed ssh setup so I guess I will use one account on ssh and the other on https.

Thanks!

Steve Streeting [Atlassian] · 14,675 karma ·

Alternatively you can use one single BB account locally but assign permissions to that account to the repos owned by other accounts. You might want to try out the Organisations feature on BB to make that easier!

Looking for something else?

Find Questions…

or Browse other questions tagged:

or Ask a Question