git clone下载时遇到的问题解决

在下载代码时遇到过两次同样的问题,因此特将解决办法在此记录下去,希望可以帮助也有共同困扰的小伙伴!

在git clone下载代码时遇到如下错误:
Username for 'https://github.com': Newbie
Password for 'https://Newbie@github.com':
Counting objects: 11507, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8210/8210), done.
Writing objects: 100% (11506/11506), 21.75 MiB | 0 bytes/s, done.
Total 11506 (delta 2213), reused 11504 (delta 2211)
efrror: RPC failed; result=56, HTTP code = 200
atal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

在百度之后有如下两种解决方式:

第一次用下列方式解决:

引起原因:


            Cause #1 git debug output has error: RPC failed; result=56, HTTP code = 200
                 Error code 56 indicates a curl receive error of CURLE_RECV_ERROR which means there was some issue that prevented the data from being received during the clone process. 
Typically this is caused by a network setting, firewall, VPN client, or anti-virus that is terminating the connection before all data has been transferred.
(网络设置,防火墙,VPN客户端,反病毒(在数据传输完成之前会使其终止))

           Cause #2 There is no error code and git debug log shows that Nginx is configured as reverse proxy. Git clone fails after 1 GB.
                e.g.

              < HTTP/1.1 200
              < Server: nginx/1.10.2

    解决办法:(在运行的git命令的路径下运行下列命令)
             On Linux

              Execute the following in the command line before executing the Git command:

                                export GIT_TRACE_PACKET=1
                                export GIT_TRACE=1
                                export GIT_CURL_VERBOSE=1

           On Windows

                     Execute the following in the command line before executing the Git command:

                                 set GIT_TRACE_PACKET=1
                                 set GIT_TRACE=1
                                  set GIT_CURL_VERBOSE=1

但是第二次遇到同样问题的时候上述方法依旧解决不了,再次寻找解决办法,如下:

The problem is most likely because your git buffer is too low.

You will need to increase Git’s HTTP buffer by setting the git config var “http.postBuffer” to 524288000.

git config --global http.postBuffer 524288000

此命令要运行在git 环境下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值