Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 781
functional_overflow Avatar asked Sep 07 '15 11:09

functional_overflow


People also ask

Can not push SourceTree?

It is a bug in sourcetree. A workaround for the issue is when sourcetree autofills the "Remote branch" field in the push dialog the first time pushing a new branch from local, Delete what ever sourcestree autofills and enter it manually or copy and past the previous values and the push will work.


2 Answers

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!

like image 54
JPelletier Avatar answered Sep 23 '22 07:09

JPelletier


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

enter image description here

like image 29
AlikElzin-kilaka Avatar answered Sep 23 '22 07:09

AlikElzin-kilaka