Golang——安装git工具失败,Failed to connect to github.com port 443 after 21078 ms: Couldn't connect to server

发布时间 2024-01-06 23:37:18作者: 也许明天

Golang——Failed to connect to github.com port 443:Timed out

解决方案:
1、首先使用浏览器确认包是否可正常访问到 2、查看当前git是否设置了其他代理或指定的地址,由于该仓库地址下没有导致。
<code>-- 查看是否设置
 git config --global http.proxy
-- 去除相关设置
 git config --global --unset http.proxy
</code>
3、拉取再试尝试,如果仍不成功,可再设置git config --global url.git@github.com:.insteadOf https://github.com/使其地址都走https尝试。
4、仍然失败,则设置hosts文件进行再次尝试。