关于github push和clone超时解决方法

1.遇到的问题

 

 2.解决

1.如果无法ping通github网址

ping github.com

 

需要在hosts【C:\Windows\System32\drivers\etc\】中添加

#github地址
140.82.112.4 github.com
199.232.69.194 github.global.ssl.fastly.net

注意:需要先查询github.com 和 github.global.ssl.fastly.net的Ip

https://www.ipaddress.com/

2.ping 通之后还是不能push 和clone则需要挂代理

 

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080

 

注意:1080是代理的端口号,需要查看你自己的VPN使用的端口号比如:

 

posted @ 2023-03-17 17:19  SpriteZzz  阅读(839)  评论(0)    收藏  举报