Cygwin“git 克隆”给出“远程端意外挂断”针对 Ubuntu 10.04.1

发布于 2024-09-24 06:59:21 字数 1005 浏览 4 评论 0原文

我正在研究如何让 Eclipse (Windows 7) 针对我们新近 git 迁移的 CVS 存储库工作,我已将其放入 Ubuntu 10.04.1 LTS 主机上的 gitosis 中。所有软件都使用 apt-get 安装(git、gitosis 等)。

尝试签出时,带有 egit 的 Eclipse 挂起,因此我正在使用命令行客户端。 Cygwin 有 git 和 openssh,所以我希望它至少能工作(然后我们可以针对本地副本使用 Eclipse)。为了仅进行初步操作,我将 gitosis 存储库克隆到另一台具有更多磁盘空间的 Ubuntu 主机上,并尝试将其克隆到我的 Windows 机器上。

我收到以下错误消息,这让我很困惑:

tra@TRA /cygdrive/c/Users/tra/git
$ git clone [email protected]:/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

Ubuntu 上的 git 是 1.7.0.4,Cygwin 中的 git 是 1.7.2.3。 scp 和 sftp 工作得很好。

我需要知道一些巫术技巧才能使这项工作成功吗?

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 [email protected]:/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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

眼藏柔 2024-10-01 06:59:21
  • 首先,您应该将公共 ssh 密钥发布到 10.49.160.91:/home/ravn/.ssh/authorized_keys 文件,以便不再需要输入密码。

  • 其次,这种错误通常发生在互操作环境中,文件具有相同的名称,但大小写不同。
    你可以检查一下你这里是否有这样的问题。

另请确保:

作为替代方案(正如 OP Thorbjørn 发现的那样),请尝试从 msysgit版本,基于mingw(而不是cygwin打包的git)

  • 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)

娇妻 2024-10-01 06:59:21

我想我遇到了同样的问题。对我来说解决这个问题的方法是使用 Cygwin Git 和 PuTTY 进行 ssh,而不是 Cygwin 的 ssh。

我尝试了 PuTTY 解决方法,因为此 Cygwin 邮件列表线程中的信息:

这个 Cygwin 邮件线程似乎也指出了 Git 版本 1.7 的 Cygwin/OpenSSL/Git 中的一些问题.1(我使用的是 Git 1.7.3.3,因此问题可能跨越多个版本):

如果您已经有一个有效的 Cygwin Git + Cygwin ssh 配置,您可能不需要从头开始。对我有用的是

  1. 从 PuTTY 网站下载 puttygen.exe、plink.exe、pageant.exe 和 putty.exe。
  2. 运行 puttygen.exe 将现有的 Cygwin .ssh 私钥转换为 PuTTY .ppk 私钥,然后将其保存在某个位置。
  3. 运行pageant.exe,加载PuTTY私钥并授权。
  4. 接下来,运行 putty.exe 以 ssh 到要从 Git 访问的主机上,这样您就可以将该主机保存到 Windows 注册表中的已知 ssh 主机列表中。
  5. 最后,您需要将 Git 配置为使用 PuTTY 而不是 Cygwin ssh。为此,请将环境变量 GIT_SSH 设置为指向 plink.exe 可执行文件。例如,export GIT_SSH=/cygdrive/c/somedirectory/plink.exe

HTH

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

东京女 2024-10-01 06:59:21

您是如何创建密钥的?

你是从类似 cygwin 的 shell 中使用 cygwin,还是从类似 git bash 的 shell 中使用 mingw git ?

我相信真正的问题是 cygwin 的 ssh 在 /home/name/.ssh 中查找 .ssh,而 mingw 的 git ssh 在 c:/user/name 中查找 .ssh /.ssh

很可能您的密钥位于这些目录中的一个且仅之一中。

您可以尝试使用 -i 开关告诉 cygwin 的 .ssh 使用不同的身份文件,或者将密钥移到两个目录中,或者在 /home/name/.ssh/config 中创建一个 ssh 配置文件。

我创建了一个配置,其中包含:

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

鉴于我可以使用 git bash 中的 mingw git 或 rxvt 中的 cygwin git 与 github 交互。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文