在git clone/pull的时候经常会遇到类似这样的报错:
fatal: unable to access 'https://github.com/xxx.git/':
Failed to connect to github.com port 443 after 21073 ms: Timed out
网上提供多种办法,一种可以稳定解决问题的方法是:
- 在本地找到代理(对于windows系统):windows设置 -> 网络与Internet -> 代理 ,可以看到代理的地址和端口。
- 比如我的地址是 127.0.0.1,端口是7890。
- 设置代理:命令行输入如下命令
-
git config --global http.proxy http://127.0.0.1:7890 git config --global https.proxy http://127.0.0.1:7890
- 记得改成自己相对应的代理ip地址和端口。
-
这样完成后就可以愉快地进行git clone/pull了!