git clone代码老是失败

1、Git限制了推送数据的大小致使的错误。

解决:从新设置通讯缓存大小git

git config --global http.postBuffer 524288000github

2、GitHub.com没法访问,链接超时

分析:怀疑链接不到github.com,在cmd窗口中,尝试ping一下百度。缓存

命令窗口:ping www.baidu.com   post

而后再ping一下github.com

C:\Users\Bai>ping github.comspa

正在 Ping github.com [111.13.100.91] 具备 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。.net

111.13.100.91 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),ssl

确实ping不通。cmd

所以怀疑是:本地DNS没法解析致使的。it

3、错误解决ast

打开C:\Windows\System32\drivers\etc\hosts,

确实没有github.com的解析 
在文件末尾添加以下内容,并保存:

192.30.255.112  github.com git 
185.31.16.184 github.global.ssl.fastly.net  

重启cmd窗口,继续ping一下github.com:

 3、今天(2019-11-19)又遇到了

上述办法都尝试了仍是不行,因而我这样作成功了

git clone https://github.com/xxx.git

提示下载失败,

能够尝试把https://换成 git://

git clone git://github.com/xxx.git

相关文章
相关标签/搜索