git-bash中无法访问github服务器的问题

1.使用git从github克隆仓库出现以下错误代码

fatal: unable to access 'https://github.com/boostorg/python.git/': Failed to con nect to github.com port 443 after 21067 ms: Couldn't connect to server

2.使用scoop的命令scoop update也会出现类似的错误

fatal: unable to access 'https://github.com/ScoopInstaller/Scoop.git/': Failed to connect to 127.0.0.1 port 443 after 2077 ms: Couldn't connect to server

3.问题出现的原因

本机系统代理端口和git端口不一致

4.解决问题:查看系统代理端口,然后配置git端口

查看本机系统的代理端口:我用的clash for windows, 默认端口是7890

# 在git-bash或cmd或powershell中配置git端口
git config --global http.proxy http://127.0.0.1:7890

5.打开Clash for Windows的TUN mode即可省略以上步骤(更新于2023年10月28日)

如何打开TUN mode

posted @   Guanjie255  阅读(387)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示