Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had to switch from Ubuntu so that I could use Adobe Suite at full speed and now I'm finding that SSH on windows is not as unified as on linux.

So I installed msysgit and putty but I'm finding that git is having trouble using putty for SSH. (I did install msysgit on the windows path and using plink).

I am trying to add a remote on my git project now to a server on a non-standard port by using a /.ssh/config file like

Host 255.255.255.255
Port 22222

Then I add the data to my git repo:

git remote add origin user@255.255.255.255:~/git/repo

But when I try to push I get an error message.

$ git push origin master
FATAL ERROR: Network error: Connection refused
fatal: The remote end hung up unexpectedly

So then I tried just using SSH from the git console:

ssh user@255.255.255.255

Which prompts me for my private key passphrase (which it doesn't have) and when I fail at that it asks me for my SSH user password (which works).

Since I am going to disable SSH login by password I need git to start using my key correctly.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I have a similar workflow but use gitosis to manage the repo on my VPS.

I use the msysgit bash with the windows path and plink as you suggest above but in addition I use pagent to manage the SSH key.

To access my repos this is the order I take,

  • Open Pagent and access my key (you only enter the passphrase here once if you have one and even if you do it remembers it for the whole session).
  • Then open Git bash and add/commit/push/pull/clone as normal.

One caveat I will note is that I had to convert the key I created with the Git bash using Putty Gen (available on the same link above) so that Pagent could use it.

share|improve this answer
    
Don't forget to set GIT_SSH=C:\Program Files\PuTTY\plink.exe –  grawity Jun 21 '10 at 18:14
    
Not having pagent running was half my problem - thanks! –  Xeoncross Jun 22 '10 at 4:34
add comment

If you can accept not having a passphrase on that key, you could removing the passphrase... otherwise this question might provide some guidance.

share|improve this answer
    
Thats just it, my private key doesn't have a passphrase yet it's still asking for one. –  Xeoncross Jun 21 '10 at 17:24
add comment

I wasn't specifying the connection string correctly.

$ git remote add test ssh://user@domain.tld:22222/~/git/repo

I also didn't have pagent running to manage my keys for me. ;)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.