我的git客户端在尝试克隆存储库一段时间后反复失败,出现以下错误。
这里的问题是什么?
注意:我已经向GIT托管提供商注册了我的SSH密钥
Receiving objects: 13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly
我的git客户端在尝试克隆存储库一段时间后反复失败,出现以下错误。
这里的问题是什么?
注意:我已经向GIT托管提供商注册了我的SSH密钥
Receiving objects: 13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly
当前回答
对我来说,问题是安装在MacOS上的诺顿安全。一旦我临时禁用防火墙和其他诺顿保护,我的git推送工作正常。
其他回答
http。postBuffer的把戏对我没用。然而:
对于遇到此问题的其他人,这可能是GnuTLS的问题。如果您设置了Verbose模式,您可能会看到下面代码行所示的基本错误。
不幸的是,到目前为止我唯一的解决方案是使用SSH。
我在其他地方看到过用OpenSSL而不是GnuTLS编译Git的解决方案。这里有一个针对该问题的活动错误报告。
GIT_CURL_VERBOSE=1 git clone https://github.com/django/django.git
Cloning into 'django'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 192.30.252.131... * Connected to github.com (192.30.252.131) port 443 (#0)
* found 153 certificates in /etc/ssl/certs/ca-certificates.crt
* server certificate verification OK
* common name: github.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject:
* start date: Mon, 10 Jun 2013 00:00:00 GMT
* expire date: Wed, 02 Sep 2015 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
* compression: NULL
* cipher: ARCFOUR-128
* MAC: SHA1
> GET /django/django.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.4
Host: github.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Thu, 10 Oct 2013 03:28:14 GMT
< 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
<
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 192.30.252.131... * connected
* found 153 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
* server certificate verification OK
* common name: github.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject:
* start date: Mon, 10 Jun 2013 00:00:00 GMT
* expire date: Wed, 02 Sep 2015 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance EV CA-1
* compression: NULL
* cipher: ARCFOUR-128
* MAC: SHA1
> POST /django/django.git/git-upload-pack HTTP/1.1
User-Agent: git/1.8.4
Host: github.com
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip
Content-Length: 2299
* upload completely sent off: 2299out of 2299 bytes
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Thu, 10 Oct 2013 03:28:15 GMT
< 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
<
remote: Counting objects: 232015, done.
remote: Compressing objects: 100% (65437/65437), done.
* GnuTLS recv error (-9): A TLS packet with unexpected length was received.
* Closing connection #0
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
奥林匹克广播服务公司。:修改http。postBuffer可能还需要设置Nginx配置文件,让gitlab通过调优client_max_body_size的值来接受更大的客户端尺寸。
然而,如果你可以访问Gitlab机器或其网络中的机器,就有一个解决方案,那就是使用git bundle。
转到源计算机上的git存储库 运行git bundle create my-repo。包——所有 (如转移。, rsync) my-repo。绑定文件到目标计算机 在目标机器上,运行git clone my-repo.bundle Git远程地址:path/to/your/repo.git git推
祝你一切顺利!
唯一对我有用的是:
克隆浅: Git克隆<yourrepo>—深度10 编辑。git/config如下:
之前
[remote "origin"]
fetch = +refs/heads/master:refs/remotes/origin/master
后
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
Git配置——global http。maxRequestBuffer 100 Git配置——global core.compression 0 Git获取
对我来说唯一有效的方法是使用HTTPS链接而不是SSH链接克隆回购。
对于共享带宽,尝试在负载较小时进行克隆。否则,请尝试高速连接。如果仍然不工作,请使用以下命令,
git config --global http.postBuffer 2048M
git config --global http.maxRequestBuffer 1024M
git config --global core.compression 9
git config --global ssh.postBuffer 2048M
git config --global ssh.maxRequestBuffer 1024M
git config --global pack.windowMemory 256m
git config --global pack.packSizeLimit 256m
再试着克隆一次。您可能需要根据可用内存大小更改这些设置。