git clone hangs on "Cloning into..." using GitBash

pva*_*v16 8 git github

I'm trying to clone a repository from my organization's GitHub using GitBash, but when I do a git clone, it hangs indefinitely. The output is as follows:

git clone https://github.com/myorganization/myrepository
Cloning into 'myrepository'...
Run Code Online (Sandbox Code Playgroud)

I have looked at other stackoverflow pages. git clone hangs forever on github suggests trying to cone using git clone git@github.com/myorganization/myrepository, which didn't work. It also suggests doing GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone --verbose https://github.com/myorganization/myrepository. When I do that, I notice that it's hanging at:

[...]
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
Run Code Online (Sandbox Code Playgroud)

(I can show the whole output if necessary.)

我还查看了Git 克隆、推送和拉取全部挂起且没有消息,这表明这可能是网络问题。为了诊断网络问题,我安装了 GitHub Desktop,并尝试了克隆,效果很好。因此,这不是网络问题。

我也尝试过其他一些事情:

  • 我确认我有权访问我的 GitHub 存储库(我被列为存储库中的成员)
  • 我已将我的用户名和电子邮件重置git config --global user.name[email]为随机值以触发存储库登录。(从未登录过。)
  • 我已经按照本指南重新安装了 GitBash 。
  • 我还尝试过(取消)使用git config --global --unset http.proxy和设置 http/https 代理git config --global --unset https.proxy

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

小智 13

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

希望它也适合你。