在wsl中git clone项目时遇到报错Failed to connect to github.com port 443
查阅资料,根据csdn上的文章尝试了给git设置代理
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
发现还是报错:github Failed to connect to 127.0.0.1 port 7890 after 0 ms: Couldn't connect to server
因为只尝试了0ms,我猜测可能wsl中不能直接使用windows中的代理
在一批知乎文章的评论区,找到了解决方法:
文章链接:https://zhuanlan.zhihu.com/p/153124468
(不过这篇文章的内容好像不能解决这个问题,最后还是按这条评论说的解决的)
使用tun模式后,记得关闭给git设置的代理,确保
git config --global -l
查询不到结果
知乎文章里的
export ALL_PROXY="http://172.19.80.1:7890"
也不要去运行,如果已经运行了,运行
unset ALL_PROXY
去掉ALL_PROXY
结果: