Search code examples
gitgithub

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


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'...

I have looked at other stackoverflow pages. git clone hangs forever on github suggests trying to cone using git clone [email protected]/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

(I can show the whole output if necessary.)

I've also looked at Git clone, push and pull all hang with no messages, which suggests that it may be a network issue. To diagnose the network issue, I installed GitHub Desktop, and tried the clone, which works fine. Therefore, it's not a network issue.

I've tried some other things too:

  • I confirmed that I have access to my GitHub repository (I'm listed as a member in the repo)
  • I've reset my username and email using git config --global user.name[email] to something random to trigger a login for the repo. (A login never came.)
  • I've re-installed GitBash following this guide.
  • I've also tried (un)setting http/https proxies with git config --global --unset http.proxy and git config --global --unset https.proxy

If someone could help me solve this problem, I'd appreciate it. Thank-you.


Solution

  • this helped me: https://github.com/microsoft/Git-Credential-Manager-Core/issues/364 Basically, I just had to put this command git config --global credential.provider generic and then clone.

    Hope it works for you as well.