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

相關文章
相關標籤/搜索