cannot pull Git remote repository from Sourcetree

I Generated ssh keys and configured my git and SourceTree. I could git pull and do other operations from Git-bash. Note: I have added the following in .bashrc to make it work.

eval `ssh-agent`
ssh-add

However, when I try to git pull in SourceTree, I get this.

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin Permission denied (publickey,password). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

When I tried to create ssh-key from Putty(windows), it goes further, but waits with this following message!

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin 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 0f:ee:bb:1c:6c:b4:50:0e:54:d6:e9:55:9b:38:45:df 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 connection.

if I open the terminal in SourceTree(which is git-bash), it asks me for passphrase. So, i suspect my .bashrc is not sourced by SourceTree. Or am I missing something else?


I had the same problem and the solution for me was to call plink.exe manually with my server (GitLab):

"C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" gitlab.com

Press y when asked and you should be fine now!


I changed the client configuration from putty to openssh. Did the job. Screencap:

enter image description here


I was able to fix the problem by changing from "Putty/Plink" SSH to "OpenSSH" for the SSH provider.

Menu Tools > Options then SSHClient, select OpenSSH