解决git推送443问题

如果你遇到以下问题

fatal: unable to access 'https://github.com/xxxxx.git/': Recv failure: Connection was reset
19:55:51.505: [school-manager] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master
fatal: unable to access 'https://github.com/xxxxxx.git/': Failed to connect to github.com port 443 after 21036 ms: Couldn't connect to server
19:58:51.304: [school-manager] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master
fatal: unable to access 'https://github.com/xxxxxx.git/': Failed to connect to github.com port 443 after 21048 ms: Couldn't connect to server
20:12:25.295: [school-manager] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master

可以去C:\Windows\System32\drivers\etc\hosts修改host文件,当然直接去肯定会出现权限问题

这个时候从设置打开cmd(管理员权限)

输入以下命令(在文件末尾追加内容)

echo 20.205.243.166 github.com >> C:\Windows\System32\drivers\etc\hosts

这里的20.205.243.166可以通过以下命令获取

ping github.com

成功


解决git推送443问题
http://www.404np.com:8080/archives/1721996071185
作者
北冥有鱼,其名为鲲
发布于
2024年07月26日
更新于
2024年07月26日
许可协议