1

I am in the process of figuring out how to get Eclipse (Windows 7) working against our freshly git-migrated CVS repository which I have put in gitosis on an Ubuntu 10.04.1 LTS host. All software is installed with apt-get (git, gitosis, etc.).

Eclipse with egit hangs when trying to check out, so I am playing with command line clients. Cygwin has git and openssh, so I'd like that to work at least (then we can use Eclipse against the local copy). To do only babysteps I have cloned the gitosis repository on another Ubuntu host with more diskspace, and try to clone that on my Windows box.

I get the following error message which puzzles me quite a bit:

tra@TRA /cygdrive/c/Users/tra/git
$ git clone ravn@10.49.160.91:/home/ravn/cvs2git/git00
Cloning into git00...
Enter passphrase for key '/home/tra/.ssh/id_rsa':
remote: Counting objects: 64045, done.
remote: Compressing objects: 100% (17965/17965), done.
fatal: The remote end hung up unexpectedly.98 MiB | 8.21 MiB/s
fatal: early EOFs:  98% (62852/64045), 310.98 MiB | 8.21 MiB/s
fatal: index-pack failed

git is 1.7.0.4 on the Ubuntu box, and 1.7.2.3 in Cygwin. scp and sftp work nicely.

Is there some Voodoo-trick I need to know to make this work?

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • A bit of investigation today showed that egit 0.9 for some reason hangs on our repository, but that egit 0.10 doesn't. Hence I've begun looking into egit again. – Thorbjørn Ravn Andersen Feb 03 '11 at 18:16
  • 1
    The problem is definitively ssh on cygwin, and I assume it is time-related. Here it always happens in a virtual machine, but not in a standalone Windows environment. Also it has something to do with the name resolution. When you enter the ip address in c:/Windows/System32/drivers/etc/hosts, it works. – Slesa Jan 08 '12 at 09:12

3 Answers3

1
  • First you should publish your public ssh key to 10.49.160.91:/home/ravn/.ssh/authorized_keys file in order to not have to enter your passphrase anymore.

  • Second this kind of error usually takes place in an interop environment, with files having the same name but with different case.
    Can you check if you have such a problem here.

Make sure also to:

As an alternative (as the OP Thorbjørn found out), try git checkout from the msysgit version, based on mingw (instead of the git packaged with cygwin)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. Right now, I'll live with the authorized_keys missing, as it tells me that the key is recognized by the other end. It turned out that the git in msysgit can check out the files, so I'll use that for now and come back to the cygwin one later. – Thorbjørn Ravn Andersen Sep 20 '10 at 12:14
  • 1
    @Thorbjørn: good point. I have added your suggestion (using msysgit instead of cygwin git) in my answer. – VonC Sep 20 '10 at 12:19
1

I think I encountered the same issue. What resolved it for me was to use Cygwin Git with PuTTY for ssh instead of Cygwin's ssh.

I tried the PuTTY workaround because of information in this Cygwin mailing list thread:

This Cygwin mail thread also seemed to point to some problem in Cygwin/OpenSSL/Git for Git version 1.7.1 (I'm on Git 1.7.3.3, so the problem may span several versions):

If you already had a working Cygwin Git + Cygwin ssh configuration, you may not need to start from scratch. What worked for me was to

  1. Download puttygen.exe, plink.exe, pageant.exe and putty.exe from the PuTTY website.
  2. Run puttygen.exe to convert your existing Cygwin .ssh private key into a PuTTY .ppk private key, and then save it somewhere.
  3. Run pageant.exe, load the PuTTY private key, and authorise.
  4. Next, run putty.exe to ssh onto the hosts you want to access from Git, so you can save the host to the list of knows ssh hosts in the Windows registry
  5. Finally, you need to configure Git to use PuTTY instead of Cygwin ssh. To do this, set the environtment variable GIT_SSH to point to the plink.exe executable. E.g., export GIT_SSH=/cygdrive/c/somedirectory/plink.exe

HTH

Rob
  • 1,350
  • 12
  • 21
0

How did you create your keys?

Did you use cygwin from a cygwin like shell, or did you use mingw git from a git bash like shell?

I believe the real problem is that cygwin's ssh looks for .ssh in /home/name/.ssh and mingw's git ssh looks for .ssh in c:/user/name/.ssh

Chances are your keys are in one and only one of these directories.

You can trying telling cygwin's .ssh to use a different identity file using the -i switch, or move the keys into both directories, or create an ssh config file in /home/name/.ssh/config.

I created a config that contains:

Host github.com
    User jerryasher
    Hostname github.com
    IdentityFile c:/Users/jerry/.ssh/id_rsa

And given that I can use either the mingw git from git bash or cygwin's git from an rxvt to interact with github.

Jerry Asher
  • 836
  • 2
  • 10
  • 23