VisualStudio2022使用git推送报错解决 Failed to connect to github.com port 443 的问题

无法连接到github.com端口443:无法连接到服务器。

出现的问题:无法将本地代码提交到 Github 仓库。

原因有:++网络连接原因或防火墙++

先测试gitHub的连接使用命令提示框查看是否可以进行ping通,有下图的数据回复说明是可以ping通的

复制代码
ping github.com

如果ping命令失败或显示高延迟,则表示存在网络连接问题。可能需要联系网络管理员或互联网服务提供商寻求帮助。

防火墙限制

电脑有配置好的vpn先看下网页端git是否能打开能打开的话,git则是需要配置代理

打开电脑的设置,找到"网络和Internet",找到代理,找到手动设置代理的地址。

找到地址和端口然后用命令提示符输入

复制代码
git config --global http.proxy http://127.0.0.1:12334
git config --global https.proxy http://127.0.0.1:12334
  • --glboal 选项指的是修改 Git 的全局配置文件~/.gitconfig,而非各个 Git 仓库里的配置文件.git/config
  • port为端口号。

配置好后查看代理是否配置成功,再次尝试克隆或上传。

查看代理是否成功

复制代码
git config --global --get http.proxy
git config --global --get https.proxy

取消代理是下面的代码

复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy
相关推荐
悟能不能悟1 小时前
用cmd命令修改适配器ip
网络·tcp/ip·github
刘志辉1 小时前
git指令
git
whysqwhw1 小时前
kuiklyui core-ksp ios
github
whysqwhw1 小时前
kuiklyui core-ksp 鸿蒙
github
CoderJia程序员甲2 小时前
GitHub 热榜项目 - 日榜(2025-10-12)
ai·github·开源项目·github热榜
whysqwhw2 小时前
kuikly core-ksp 安卓
github
Tfly__3 小时前
Ubuntu 20.04 安装Aerial Gym Simulator - 基于 Gym 的无人机强化学习仿真器
linux·人工智能·ubuntu·github·无人机·强化学习·运动规划
2501_916766544 小时前
【Git学习】初识git:简单介绍及安装流程
git·学习
CoderJia程序员甲5 小时前
GitHub 热榜项目 - 日榜(2025-10-13)
ai·开源·大模型·github·ai教程
uhakadotcom6 小时前
coze的AsyncTokenAuth和coze的TokenAuth有哪些使用的差异?
后端·面试·github