报错信息:
- Failed to connect to github.com port 443
- OpenSSL SSL_read: Connection was reset, errno 10054
错误解析:
不是这个:【git 权限认证失败】(不是)
真~解析:命令行状态下被墙了网址,导致连接到远程库超时或直接失败。
解决方案:
找到如下文件,并使用记事本相关的文本应用进行编辑:
- Windows: C:\Windows\System32\drivers\etc\hosts
- Mac: ~\etc\hosts
在新的行键入以下代码:
192.30.255.112 github.com git
185.31.16.184 github.global.ssl.fastly.net
解决方案分析:
将域名解析变为IP地址解析。
其实很多有很多类似的,比如Mac下的Cocoapods,npm库引用等。
引申:
分享一个hosts文件:
1 2 3 4 5 6 7 8 |
# fixed https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com - Githubusercontent Website # 185.199.108.133 raw.githubusercontent.com 199.232.68.133 raw.githubusercontent.com # unity upm load git error fix: 192.30.255.112 github.com git 185.31.16.184 github.global.ssl.fastly.net 192.168.56.1 windows10.microdone.cn |