cannot pull Git remote repository from Sourcetree
Solution 1
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
I changed the client configuration from putty to openssh.
Go to: Menu Tools
> Options
> SSH Client
Solution 3
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
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
Related videos on Youtube
functional_overflow
Updated on July 09, 2022Comments
-
functional_overflow almost 2 years
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?
-
Roman Pokrovskij over 5 yearsAtlassian KB article: confluence.atlassian.com/sourcetreekb/…
-
-
May12 over 8 yearsIt asked login/and password. What to do? I use rsa key.
-
SaeX over 8 years@May12: no password is required at this stage. Just hit "y" to store the key in cache. Then return to SourceTree and you should no longer see the error.
-
tyoc213 about 8 yearsThanks!! it would be nice to know why source tree cant to this by itself!!! or popup a screen where it ask about!
-
Mårten about 8 yearsWorked great, i have a specific port also which required setting with the -P option.
-
AlikElzin-kilaka about 8 yearsWorked on SourceTree v1.8.2.11.
-
haakym about 8 yearsWorked for me too using
plink bitbucket.org
from my git bash in windows. Thank you! -
Changhoon about 8 yearsThank you. (win7 64bit, sourcetree v1.8.2.11, ssh)
-
Enrico Bottani about 8 yearsThanks :D win10 64bit, 1.8.3
-
Derek almost 8 yearsThis worked out for me. If you have a working git cmd line already on your computer and a working private key for password-less operation, this is probably what you need to do.
-
Stackman about 7 yearsWorked for me! I think I accepted some Mercurial download when I installed Sourcetree and this may have caused this issue but im not sure.
-
Azimuth about 6 yearsIn my case the server wants me to authenticate but does not accept the private key...
-
Oliwer Lisek almost 2 yearsSave my life. Brilliant <3