4

我已经在我的几台计算机上安装了 msysGit,并且只在一台特定的计算机(当然是我的主要工作计算机)上遇到了问题。'git 克隆' 不起作用。当我在存储库上运行克隆命令时,会发生这种情况:

C:\Projects>git clone git://github.com/[user]/[project].git
Initialized empty Git repository in C:/Projects/[project]/.git/

它开始填充 .git 目录,但从不下拉任何其他内容。我已经让它运行了几个小时,看看它是否至少会引发错误。它继续坐在那里。如果我尝试取消它,它工作得很好。它似乎永远不会拉下存储库。我已经在多个地方的多个存储库上尝试过这个。有谁知道可能发生了什么?

4

2 回答 2

4

您是否尝试使用 http 地址进行克隆?

目前是带有相同问题的 msysgit(问题 136)的票证,目前的解决方法是使用 http 而不是 git 地址进行克隆。

其他尝试的动作:

  • GIT_TRACE=1(并发布输出)
  • 尝试使用其他或旧版本的 msysgit
  • 检查主计算机上的任何防火墙/防病毒问题

在这里切换到旧版本的 msysgit 可能是正确的选择:
请参阅此GitHub 支持线程

您使用的是 msysGit 的 1.6.4 预发行版吗?它存在已知的错误。
我们建议使用稳定版本,例如 1.6.0。

谢谢克里斯,就是这样:切换回以前版本的 msysGit (Git-1.6.3.2-preview20090608.exe) 后,问题不再发生。


该问题实际上可能会影响任何 Git1.6.4 及更早版本:

git 尝试通过发送HEAD请求来检查包文件是否存在,但会因某些(如果不是全部)github 返回的 500 错误而窒息。

使用记者使用的存储库:

$ curl http://github.com/grails/grails.git/objects/info/packs
P pack-1290e84bed53bda28f0989dca48d836bd9104031.pack
P pack-bf40d38ae780512994e5127e832ed9d8853c186d.pack
P pack-f490d5f7d4671368f4a52c618ca9dce13b714ba1.pack
P pack-79e3a7f30e8989acc8403ac688be669a05384eef.pack

$ curl -I http://github.com/grails/grails.git/objects/pack/pack-bf40d38ae780512994e5127e832ed9d8853c186d.pack
HTTP/1.1 500 Internal Server Error
Server: nginx/0.6.26
Date: Fri, 04 Sep 2009 13:50:20 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Content-Length: 3193
Cache-Control: no-cache

看到这个线程
GitHub 支持团队目前正在调查该问题:

我不认为 500 是故意的,但我们的设置可能有一些奇怪的东西导致了它们。
我有一张票可以进一步调查这个问题。我有一种感觉,直到搬家之后我们才会搞砸这个,因为它可能与服务器配置有关。


Git1.6.4.4 确实包含自 9 月 16 日以来的修复:

The workaround for Github server that sometimes gave 500 (Internal server error) response to HEAD requests in 1.6.4.3 introduced a regression that caused re-fetching projects over http to segfault in certain cases due to uninitialized pointer being freed.

But mssysgit has yet to release (September 21th) any new build since the original 1.6.4 late July. (They are probably waiting for 1.6.5 or 1.7)

于 2009-09-21T04:01:01.623 回答
-1

I had this problem, and it turned out that it was the step accepting the remote host key that was blocking. I just ssh'd normally to the host, accepted the key, and then went back to git and everything was working.

于 2015-06-29T08:24:33.073 回答