关于git使用期间产生的问题汇总及解决

摘要:

针对git在拉取(pull)时出现的:
1、Failed to connect to github.com port 443: Timed out
2、error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
3、速度非常慢
这三个问题的的解决方案

问题描述

如果出现上述1情况,那别试了,你拉不下来的。

如果出现上述2、3两种情况的时候,经过多次拉取实际上还是能够进入拉取阶段的,不过拉取的速度很慢,而且如果你拉取的项目比较大,大概率会出现以下现象:

remote: Counting objects: 5578, done.
remote: Compressing objects: 100% (5788/5788), done.
error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

然后拉取失败

解决方案

1、在git所在的文件夹,进入bash,输入命令

git config http.sslVerify "false"

2、如果出现

fatal: not in a git directory

3、则表示该文件并非一个git文件夹,需要先初始化

git init

4、重新进行git clone,此时对于小文件来说,是能够拉取成功的,但是如果文件比较大,大概率还是会回到

remote: Counting objects: 5578, done.
remote: Compressing objects: 100% (5788/5788), done.
error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

5、修改git缓存的大小,100M不行就1000M,并且在host文件(C:\Windows\System32\drivers\etc\hosts)里添加如下两行

git config --global http.postBuffer 100M
151.101.72.249 http://global-ssl.fastly.net
192.30.253.112 http://github.com

6、这时候会发现,速度由原来的7、8k变成了 100-200k,此时已经能够解决大部分的拉取失败的问题,如果最终还是失败了 回到了4,那么别犹豫了,翻墙,你的速度会直接飙到 “几M”,并且翻墙后几乎不会出现4的情况(我只遇到过1次)

猜你喜欢

转载自blog.csdn.net/weixin_40301728/article/details/128961174