git push 超时

448 阅读1分钟

问题描述:

fatal: unable to access '[https://github.com/****/':](https://github.com/****/':) Failed to connect to github.com port 443 after 21118 ms: Timed out

解决方案1 :

取消 http 代理

git config --global --unset http.proxy

取消 https 代理

git config --global --unset https.proxy

手动刷新 DNS 缓冲

ipconfig /flushdns

解决方案2:

通过站长工具查询以下网站对应的ip地址

github.com
20.205.243.166
assets-cdn.github.com
185.199.109.153
github.global.ssl.fastly.net
185.199.109.153

将以上查询结果以 ip 域名的方式写到 hosts 文件中
hosts 文件路径:C:\Windows\System32\drivers\etc
如图: image.png