首页 > 解决方案 > git clone 使用 GitBash 挂在“克隆到...”上

问题描述

我正在尝试使用 GitBash 从我组织的 GitHub 克隆存储库,但是当我执行 a 时git clone,它会无限期挂起。输出如下:

git clone https://github.com/myorganization/myrepository
Cloning into 'myrepository'...

我查看了其他 stackoverflow 页面。git clone 在 github 上永远挂起建议尝试使用 锥git clone git@github.com/myorganization/myrepository,但没有用。它还建议做GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone --verbose https://github.com/myorganization/myrepository. 当我这样做时,我注意到它挂在:

[...]
11:44:04.432276 http.c:721              <= Recv header, 0000000057 bytes (0x00000039)
11:44:04.432276 http.c:733              <= Recv header: x-github-request-id: CEEF:07BD:11FD966:1D089D5:60D380F4
11:44:04.432276 http.c:721              <= Recv header, 0000000023 bytes (0x00000017)
11:44:04.432276 http.c:733              <= Recv header: x-frame-options: DENY
11:44:04.432276 http.c:721              <= Recv header, 0000000002 bytes (0x00000002)
11:44:04.432276 http.c:733              <= Recv header:
11:44:04.432276 http.c:774              == Info: Connection #0 to host github.com left intact

(如有必要,我可以显示整个输出。)

我还查看了Git clone, push and pull all hang with no messages,这表明它可能是网络问题。为了诊断网络问题,我安装了 GitHub Desktop,并尝试了克隆,效果很好。因此,这不是网络问题。

我也尝试了一些其他的东西:

如果有人可以帮助我解决这个问题,我将不胜感激。谢谢。

标签: gitgithub

解决方案


这对我有帮助:https ://github.com/microsoft/Git-Credential-Manager-Core/issues/364 基本上,我只需要输入这个命令git config --global credential.provider generic然后克隆。

希望它也适用于你。


推荐阅读