Can't clone any repository through SSH from SourceTree

I have just installed SourceTree on windows and tried to clone my repository from Bitbucket or any git hosting site at all (tried GitLab and GitHub). When trying to clone from GitHub, I get through the windows where you put the URL and path just fine, but then hangs on the cloning process with the following output:

git -c diff.mnemonicprefix=false -c core.quotepath=false clone --recursive C:\Users\Pavle\dev\WebPhoto
Cloning into 'C:\Users\Pavle\dev\WebPhoto'...

warning: templates not found C:\Program Files\Git\share\git-core\templates

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48

If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the

Now, I do understand that PuTTY is waiting for confirmation, just like OpenSSH on Linux (which I usually use and have experience with), but it's not a terminal window, just an output log. I have no idea how to accept the servers public key to get a secure connection, but I guess it should accept it by default.


When trying to clone from Bitbucket or GitLab I can't even get past the clone info window, it just loads the repo info forever. My guess is that it's the same problem, only it manages to get the repo info from GitHub through HTTP.

I wanted to add the public server keys manually, but I can't find the known_hosts file anywhere, maybe PuTTY doesn't even use that format and if no, is there a way to add the keys manually somewhere?


Also, yes I generated private keys and added them to the ssh-daemon (the one embedded in SourceTree) and added the public keys to each of my accounts. And when trying to use the same private keys from the Windows Git bash to clone repos, it works just fine (after adding them to the OpenSSH agent).

1 answer

If you open up the terminal with SourceTree's Terminal button, and attempt to ssh to the server(s) in question, you'll be prompted to accept the key. Once you accept it, you should be able to clone.

Note: it does not matter whether you're actually allowed to make a direct SSH connection, the key check happens before the server checks those settings.

Still not working. I tried cloning through the terminal, but it didn't ask me to accept the key, probably because I have already cloned it from the terminal before, which means that the key is cached, but SourceTree doesn't access the same file as OpenSSH does.

Update: Tried with github, same thing. I accepted the key in the terminal and the clone process in SourceTree stopped on the key confirmation again

If your terminal is using OpenSSH, why isn't SourceTree?

Well i mean it's using PuTTY for generating keys, for the ssh-daemon and I found the command line ssh client in the installation folder, so I'm pretty sure it's using PuTTY by default.

Ok, well, try to connect to those addresses with PuTTY, and see if it prompts you to accept the key.

After opening a cmd in the folder where SourceTree has the PuTTY tools installed and connecting to all of the 3 git sites (I accepted the keys), I am now able to clone github repos, but gitlab and Bitbucket still wont load in the clone window


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,235 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you