错误原因
由于Http协议错误,当 pull 或者 clone 的时候,或者是 github 某个CDN被伟大的墙屏蔽所致。
解决办法1
协议错误
先执行下列命令
git config --global http.postBuffer 524288000再执行git pull或者 git clone 命令
解决办法2
墙屏蔽
- 
访问 http://github.global.ssl.fast...获取cdn域名以及IP地址 
- 
访问 http://github.com.ipaddress.c... 获取cdn域名以及IP地址 
修改hosts文件
将上述获取的IP地址添加到hosts文件中
Mac在/etc/hosts中;
windows在C:\Windows\System32\drivers\etc\hosts中;
# fix git clone github project failed
140.82.113.3 github.com
199.232.5.194 github.global.ssl.fastly.net刷新DNS缓存
Mac刷新DNS缓存
sudo killall -HUP mDNSResponder
sudo dscacheutil -flushcacheWindows更新DNS缓存
cmd命令窗口执行:
ipconfig /flushdns使增加的映射生效。
 
                    
                     
                    
                 
                    
                 
 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号