Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source Tree for Windows doesn't seem to work with valid SSH key

I have created an ssh key pair using putty within Source Tree on Windows, and then added that to my repo client (I use Gitlab on a personal server).

This works fine from gitbash (cloning and pushing etc) and via SourceTree for OSX but after adding the .ppk key to pageant, which is actively running and seems to have loaded the key correctly, I cannot seem to clone via SourceTree. I get a "This is not a valid source Path/URL" when adding the repo path with details stating:

fatal: Could not read from remote repository. Please make sure you have the correct access rights and repository exists.

If I add an existing repo that I have cloned using the same ssh key pair via git bash (by just drag dropping the folder into Source Tree for Windows) that seems to work up to a point - I can commit and see history etc. When I try to Push, however, it fails with much the same message (I've altered the repo path):

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master Pushing to [email protected]:MyRepo.git

fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Completed with errors, see above.

As far as I can tell Pageant is up and running with the correct (well only) ssh key on my machine.

Any help is very welcomed.

like image 723
Hobsie Avatar asked Apr 02 '13 18:04

Hobsie


1 Answers

Ok so this is a little embarrasing/confusing.

It would seem that I did not copy the correct public key onto my repo management web interface. The thing is, I copied the public key from git bash using the command:

clip < ~/.ssh/id_rsa.pub

But that seems to give me a different public key from what I actually get opening id_rsa.pub in a text editor...

Is that normal? Why is it different? Why does it work within gitbash and not in SourceTree (via pageant).

Anyway, copying the contents of my public key in directly from the file when opened in notepad got things to work with SourceTree and Pageant etc.

like image 110
Hobsie Avatar answered Sep 22 '22 06:09

Hobsie