cannot pull Git remote repository from Sourcetree
GitGithubSshAtlassian SourcetreeGit Problem Overview
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?
Git Solutions
Solution 1 - Git
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!
Solution 2 - Git
Solution 3 - Git
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
Solution 4 - Git
The best solution is to get a connection using Putty.
On the Host Name, put your gitlab project ssh address. then, click 'Open' to connect.
That's it. SourceTree trust gitlab.com after all. you may check the solution from the below link. https://answers.atlassian.com/questions/31659457/windows-7-64bits-sourcetree-openssh-putty-git-pull-not-working