“git 克隆” Windows 上的 msysGit 无法正常工作

发布于 2024-08-05 11:22:05 字数 383 浏览 2 评论 0原文

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

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

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

I have installed msysGit on several of my computers and only have problems on one particular computer (my main work computer of course). 'git clone' does not work. When I run the clone command on a repository, this occurs:

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

It starts populating the .git directory, but never pulls down anything else. I've left it going for a couple of hours to see if it would at least throw an error. It continues to sit there. If I try and cancel it, it works just fine. It just never seems to pull the repository down. I've tried this on multiple repositories from multiple places. Does anyone have a clue what may be happening?

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

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

发布评论

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

评论(2

抚你发端 2024-08-12 11:22:05

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

当前是 msysgit 的票证(问题 136),其中同样的问题,当前的解决方法是使用 http 而不是 git 地址进行克隆。

其他可尝试的操作:

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

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

<块引用>

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

谢谢 chris,就是这样:切换回以前版本的 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 日起:

Github 服务器在 1.6.4.3 中有时对 HEAD 请求给出 500(内部服务器错误)响应的解决方法引入了回归,导致在某些情况下通过 http 重新获取项目到 segfault,原因是未初始化的指针被释放。

但自最初的 1.6.4 后期以来,mssysgit 尚未发布(9 月 21 日)任何新版本七月。 (他们可能正在等待 1.6.5 或 1.7)

Did you try to clone with the http address?

The is currently a ticket with msysgit (issue 136) with the same problem, for which the current workaround is to clone with the http rather than the git address.

Other moves to try:

  • GIT_TRACE=1 (and post the output)
  • try with other or older versions of msysgit
  • check for any firewall/antivirus issue on your main computer

Here switching to an older version of msysgit could be the right option:
See this GitHub support thread:

Are you using the 1.6.4 prerelease of msysGit? There are known bugs with it.
We recommend a stable version, such as 1.6.0.

thanks chris, that's it: after switching back to the previous version of msysGit (Git-1.6.3.2-preview20090608.exe) the problem does not occur any more.


The problem might actually affect any Git1.6.4 and older:

git tries to check if the pack file exists by sending out a HEAD request, but chokes on the 500 error that some (if not all) github returns.

Using the repository used by the reporter:

$ 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

See this thread.
The GitHub support teams is currently investigating the problem:

I don't think the 500s are intentional, but there may be something odd with our setup that is causing them.
I have a ticket open to investigate the issue further. I have a feeling we won't be messing with this till after the move, since it's likely something with the server config.


Git1.6.4.4 does contain a fix since September, 16th:

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)

陪你到最终 2024-08-12 11:22:05

我遇到了这个问题,结果发现这是接受远程主机密钥的步骤被阻止。我只是正常 ssh 到主机,接受密钥,然后返回 git,一切正常。

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.

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