Issue
I've been having a bit of a head ache with trying to pull down a repository held in Gitlab. This is all done in Windows 8.1 on a Ubuntu VM by the way if that helps. I've added my public key in Gitlab and added my private key to ssh-agent ... all seems correct.
When I try and do a git pull this is where I run in to issues. It seems to me that Git is simply looking in the wrong location, my private key is stored in c/Users/Neil/.ssh but it seems as if git is looking in c/Users/Neil/.ssh/342/200/217 ...
C:\Users\Neil\code\homestead>git pull
no such identity: /c/Users/Neil/.ssh/id_rsa\342\200\217: No such file or directory
[email protected]'s password:
I've no idea why git would be looking there or am I thinking wrong about this? Can anyone shed some light on things for me?
Solution
GitLab itself isn't looking for your ssh keys: as a client, you are using ssh to contact GitLab, which means only openssh is looking for those keys.
It (openssh) will find them in:
%HOME%\.ssh
(so check what the environment variableHOME
is set to)%HOME%\.ssh\config
(where an IdentifiyFile directive can set a custom path for the ssh private key, so check if you have a.ssh/config
file)
The OP Neil Kelsey confirms in the comments that the %HOME%\.ssh\config
was causing some kind of interference.
And the push url seemed still referencing an https url.
A simple git remote set-url --push origin <ssh/url>
fixed that.
Answered By - VonC