Issues connecting via SourceTree
Asked by Alon:

Hi,

I have installed Sourcetree and tried to push my local repo to my bitbucket repo.

I have configured SSH on my local system and added the SSH key to my bitbucket account as per the various documentation and KB articles I've read.

I have verified that the connection is working using ssh -T git@bitbucket.org

But when I try connect via SourceTree I get an error saying that the Agent is running but that connection was still refused.

I have converted my ssh key to a putty-compatible one and loaded into the Pageant key list.

When I try the verbose debugging (ssh -t -vvv git@bitbucket.org) in Git Bash I receive an error : "PTY allocation request failed on channel 0" which I have not been able to find a solution for the website.

I am unable to pull or push using SourceTree

![Error.png](/t5/image/serverpage/image-id/232623iF13BBF2B83621A1E/image-size/large?v=v2&px=999 "Error.png")

![debug.png](/t5/image/serverpage/image-id/232625iB8A87F8AF1F08E26/image-size/large?v=v2&px=999 "debug.png")![test.png](/t5/image/serverpage/image-id/232624iAF91E34D3F589A5E/image-size/large?v=v2&px=999 "test.png")

Thanx,

Alon


Answers:
author: vikram
body: Hi [@Alon](/t5/user/viewprofilepage/user-id/5111102) Welcome to Atlassian Community.

From the error displayed, the shell connect to the bitbucket is denied but you can run git commands.

Can you try git clone or push or pull command as below:-

git clone git@bitbucket.org:\<account to connect bitbucket\>/\<any repository\>

If the above does not work,

Please try to generate new SSH key and try (sometimes it works)

also check if you have installed any git bash client on source tree system to hit execute git commands.

Let me know further to help.

Vikram P

comments: author: Alon
body: Hi [@vikram](/t5/user/viewprofilepage/user-id/5005662) ,

Thanx for getting back to me.

I've got git bash installed (Git Extensions) and I tried to view the remote for my repo - it listed it correctly.

To give you a bit of history - I created a local git repo as part of a migration from SVN to git, and now I want to push it to bitbucket.

I did the same thing for a few other repos and pushed them to github, but this I want to go to bitbucket.

When I tried to push my repo to the remote I got an error that there were changes in the remote that were not local - I had created the remote repo with a gitignore and readme.md file, and these were obviously the changes it was complaining about.

I tried to pull the changes but it complain about being unrelated to my local repo, so I ended up deleting the remote repo and re-creating it as an empty repo.

When I try pull new (empty) remote - I get an error: fatal: couldn't find remote ref HEAD  
followed by $ fatal: the remote end hung up unexpectedly.

I then tried to push my local repo (all branches so I have complete history) to remote and it worked from git bash.

If I use the full syntax (as you specified above) - it works to pull and fetch, but when I try in SourceTree I got a permission denied (PublicKey) error.

I deleted the tab in SourceTree and cloned again from the repo - now it seems to be working.

Thanx for the guidance and suggestions - I've managed to get it hooked up and working now.

Cheers,

Alon


author: vikram
body: [@Alon](/t5/user/viewprofilepage/user-id/5111102) I am feeling very happy, as it worked by all your efforts.

Vikram P


author: Alon
body: So far, 107 people have viewed this post and not a single suggestion or recommendation to try resolve the problem.

Does anyone have any suggestions or should I simply delete my account and use Github instead?


Tags: bitbucket

bitbucket-cloud

cloud