【问题标题】:Git clone hangs on Receiving objects on MAC OSX 10.12Git 克隆在 MAC OSX 10.12 上接收对象时挂起
【发布时间】:2016-11-18 07:37:07
【问题描述】:

我正在尝试在 mac osx 10.12 上设置 Cocoapods,我尝试在它挂在接收对象上的终端中执行此命令:-

cd ~/.cocoapods/repos
GIT_TRACE=1; GIT_CURL_VERBOSE=1 git clone http://github.com/CocoaPods/Specs.git master --verbose

这是终端输出:-

            Cloning into 'master'...
            * Couldn't find host github.com in the .netrc file; using defaults
            *   Trying 192.30.253.112...
            * Connected to github.com (192.30.253.112) port 80 (#0)
            > GET /CocoaPods/Specs.git/info/refs?service=git-upload-pack HTTP/1.1
            Host: github.com
            User-Agent: git/2.7.4 (Apple Git-66)
            Accept: */*
            Accept-Encoding: gzip
            Pragma: no-cache

            < HTTP/1.1 301 Moved Permanently
            < Content-length: 0
            < Location: https://github.com/CocoaPods/Specs.git/info/refs?service=git-upload-pack
            < Connection: close
            < 
            * Closing connection 0
            * Issue another request to this URL: 'https://github.com/CocoaPods/Specs.git/info/refs?service=git-upload-pack'
            * Couldn't find host github.com in the .netrc file; using defaults
            *   Trying 192.30.253.112...
            * Connected to github.com (192.30.253.112) port 443 (#1)
            * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
            * Server certificate: github.com
            * Server certificate: DigiCert SHA2 Extended Validation Server CA
            * Server certificate: DigiCert High Assurance EV Root CA
            > GET /CocoaPods/Specs.git/info/refs?service=git-upload-pack HTTP/1.1
            Host: github.com
            User-Agent: git/2.7.4 (Apple Git-66)
            Accept: */*
            Accept-Encoding: gzip
            Pragma: no-cache

            < HTTP/1.1 200 OK
            < Server: GitHub Babel 2.0
            < Content-Type: application/x-git-upload-pack-advertisement
            < Transfer-Encoding: chunked
            < Expires: Fri, 01 Jan 1980 00:00:00 GMT
            < Pragma: no-cache
            < Cache-Control: no-cache, max-age=0, must-revalidate
            < Vary: Accept-Encoding
            < X-GitHub-Request-Id: 69EEB048:2D36F:6AF964:57888CD0
            < X-Frame-Options: DENY
            < 
            * Connection #1 to host github.com left intact
            POST git-upload-pack (305 bytes)
            * Couldn't find host github.com in the .netrc file; using defaults
            * Found bundle for host github.com: 0x7fc3d750be30
            * Re-using existing connection! (#1) with host github.com
            * Connected to github.com (192.30.253.112) port 443 (#1)
            > POST /CocoaPods/Specs.git/git-upload-pack HTTP/1.1
            Host: github.com
            User-Agent: git/2.7.4 (Apple Git-66)
            Accept-Encoding: gzip
            Content-Type: application/x-git-upload-pack-request
            Accept: application/x-git-upload-pack-result
            Content-Length: 305

            * upload completely sent off: 305 out of 305 bytes
            < HTTP/1.1 200 OK
            < Server: GitHub Babel 2.0
            < Content-Type: application/x-git-upload-pack-result
            < Transfer-Encoding: chunked
            < Expires: Fri, 01 Jan 1980 00:00:00 GMT
            < Pragma: no-cache
            < Cache-Control: no-cache, max-age=0, must-revalidate
            < Vary: Accept-Encoding
            < X-GitHub-Request-Id: 69EEB048:2D36F:6AFF66:57888CD9
            < X-Frame-Options: DENY
            < 
            remote: Counting objects: 747987, done.
            remote: Compressing objects: 100% (17/17), done.
            Receiving objects:   1% (10862/747987), 2.16 MiB | 437.00 KiB/s   

我在 SO 上看到了关于这个问题的其他问题,不幸的是没有一个解决方案有效。

更新:-

一段时间后终端显示此错误:-

* SSLRead() return error -9806/747987), 2.16 MiB | 437.00 KiB/s   
* Closing connection 1
error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed`

【问题讨论】:

    标签: ios git macos terminal cocoapods


    【解决方案1】:

    See this answer.

    NAT 上的 VMware 为我遇到了这个问题。将其更改为桥接 (复制状态)修复了问题。

    【讨论】:

    • 谢谢,我试试
    • 如果有人在使用Bridged 时遇到问题,请尝试重置vmware network settings - Vmware / Edit / Virtual Network Editor ,按Restore Defaults,同时为VMnet0 选择正确的适配器(在我的情况下是Realtek) - @ 987654322@
    【解决方案2】:

    我确认这是我这边的网络问题。我在 Windows 10 机器上执行了这个命令:-

    git clone http://github.com/CocoaPods/Specs.git master

    然后使用终端 cp 命令将主存储库复制到 MAC OSX 机器上的此目录(使用 Finder 的正常复制会挂几个小时):-

    ~/.cocoapods/repos/master

    最后在我的项目目录上执行 pod init 然后 pod install --verbose 就像一个魅力

    【讨论】:

      猜你喜欢
      • 2018-12-19
      • 2010-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-10
      • 1970-01-01
      • 1970-01-01
      • 2015-09-04
      相关资源
      最近更新 更多