fastcatch
fastcatch

Reputation: 755

git fails on ssh communication

I recently upgraded git to 1.8.4.msysgit.0 (on Windows 7) and ever since I haven't been able to push to a repo that I've been using for years. (Note: I also downgraded to 1.7.0.2 that I used to be using for a long time but that didn't help either.)

I get this for a simple git push:

Using username "git-receive-pack 'git-myname".
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What is this strange username?

I get a similar message for a git clone as well (...git-upload-pack...). NB: I can clone via https fine.

SSH itself seems to be fine with PuTTY's plink:

C:\test>set GIT_SSH
GIT_SSH=C:\Program Files\PuTTY\plink.exe

C:\test>git remote -v
origin  ssh://[email protected]:myrepo.git (fetch)
origin  ssh://[email protected]:myrepo.git (push)

C:\test>"C:\Program Files\PuTTY\plink.exe" -v [email protected] -i mykey.ppk
Looking up host "free1.projectlocker.com"
...
Using SSH protocol version 2
...
Reading private key file ".\mykey.ppk"
Using username "git-myname".
Offered public key
...
Offer of public key accepted
...
Access granted
Opened channel for session
...

I can push to the repo via ssh from a linux box using the same key. I can also ssh to the host with OpenSSH (from Windows) but cannot set it up either so that git uses it properly.

Why does git fail?

Upvotes: 1

Views: 768

Answers (1)

fastcatch
fastcatch

Reputation: 755

After quite some sweat and fiddling around I found that git works provided: (a) the key is loaded into Pageant and (b) the ssh:// prefix is removed from the remote url.

(b) is the same as it was before I started fiddling around; (a), however, was never required. I may look after some way to avoid it but I'm too happy now to bother ;).

Upvotes: 1

Related Questions