Cygwin“git 克隆”给出“远程端意外挂断”针对 Ubuntu 10.04.1
我正在研究如何让 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,您应该将公共 ssh 密钥发布到
10.49.160.91:/home/ravn/.ssh/authorized_keys
文件,以便不再需要输入密码。其次,这种错误通常发生在互操作环境中,文件具有相同的名称,但大小写不同。
你可以检查一下你这里是否有这样的问题。
另请确保:
核心。 autocrlf
为 false。core.ignorecase
是否设置为 false(其默认值)作为替代方案(正如 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:
core.autocrlf
to false.core.ignorecase
is set to false (its default value)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)
我想我遇到了同样的问题。对我来说解决这个问题的方法是使用 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 配置,您可能不需要从头开始。对我有用的是
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
export GIT_SSH=/cygdrive/c/somedirectory/plink.exe
HTH
您是如何创建密钥的?
你是从类似 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 配置文件。
我创建了一个配置,其中包含:
鉴于我可以使用 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:
And given that I can use either the mingw git from git bash or cygwin's git from an rxvt to interact with github.