Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was able to 'git clone a repository using 'git clone' in my MS Terminal (the one start by using 'cmd').

git clone git+ssh://michael@103.116.29.18/~/Src/Test

But when I do the SAME command under cygwin. It just hangs. I have checked they are using the same instance of 'git' so my question is why it does not work under 'cygwin'?

Thank you.

share|improve this question
    
Just guessing here, but it probably has to do with the ssh key. Make sure that a) you have a public key in your $CYGHOME/.ssh and b) that your server is aware of that key. –  swasheck Apr 12 '12 at 20:47
    
I open cygwin terminal and then cd to '~' I assume it is the $CYGHOME. There is a '.ssh' directory, but it is empty. how can I create a public key to access my other machine? –  michael Apr 12 '12 at 21:07
1  
@michael: See section "Tunneling" on this page. –  Bora Apr 12 '12 at 21:21
    
ssh-keygen -t rsa OR ssh-keygen -t dsa –  swasheck Apr 12 '12 at 21:21
    
I did this, but it just hangs as well $ ssh-keygen -t rsa Enter file in which to save the key (/c/Programs/cygwin/home/michael/.ssh/id_rsa): id_rsa –  michael Apr 12 '12 at 22:13

3 Answers 3

This has always worked well for me

$ ssh-keygen -t rsa -C svnpenn@gmail.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Steven/.ssh/id_rsa):
Created directory '/home/Steven/.ssh'.

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Your identification has been saved in /home/Steven/.ssh/id_rsa.
Your public key has been saved in /home/Steven/.ssh/id_rsa.pub.
The key fingerprint is:
e2:83:fc:1c:62:b6:33:ec:69:80:86:f9:1a:5d:ab:8d svnpenn@gmail.com
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|.o  . . S        |
|+o.o + .         |
|o..oB +          |
| ..*=* o         |
|..Eo=oo          |
+-----------------+

ref

share|improve this answer

The problem is when you don't install Git on Cygwin and Cygwin uses your official installation of Git on your Windows machine. So, when you try any action that requires connection to an external repository (push, pull, clone) it just hangs. In my case I already had installed Git on my machine, so when I checked on Cygwin if Git was present using 'git --version' Git respond.

You need to run Cygwin installer again and install Git package.

Hope this help someone.

share|improve this answer

I created a user environment variable CYGHOME that points to my %USERPROFILE%, and I immediately stopped having this problem. It didn't make a new SSH keys or anything. Not like it should, either, since clone happens over HTTPS these days.

share|improve this answer

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.