【解决方法】git pull报错ssh: connect to host github.com port 22: Connection timed out

问题

复制代码
git pull
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

解决方法

在C:\Users\username.ssh文件夹下新建config文件,填入以下文本(如有则直接在文件最后一行新增):

复制代码
Host github.com
  Hostname ssh.github.com
  Port 443

将22端口修改为443即可。

验证:

复制代码
ssh -T git@github.com

出现Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.即正常。

参考资料

https://zhuanlan.zhihu.com/p/521340971

相关推荐
@呱呱爱学习4 小时前
2026年09月28日 | 呱呱AI日报】GitHub 发布 Copilot WSL 教程,介绍在 Ubuntu 中运行编程 Agent
人工智能·github·copilot
誰能久伴不乏5 小时前
看懂 Git 团队协作全流程:分支、提交、PR、rebase 到底在干嘛
git
阿里嘎多学长7 小时前
2026-09-28 GitHub 热点项目精选
开发语言·程序员·github·代码托管
程序员清风7 小时前
vLLM 实战:用 OpenAI 兼容接口部署本地大模型推理服务
开源·github·vllm
七牛云行业应用10 小时前
Jev 报 401 / api_key_required 怎么解决:TypeSafe AI 官方错误码表与排查步骤
算法·github
承渊政道10 小时前
Linux系统学习【进程信号详细解析——认识、产生、保存以及捕捉信号】
linux·学习·ubuntu·ssh·vs code·进程信号
sunshine22 girl10 小时前
git tag-项目流程
git
誰能久伴不乏11 小时前
保姆级 GitHub 协作教程
github
miofly16 小时前
Claude 自主发现类 CRISPR 结构的新型逆转录酶系统:Anthropic 生命科学实验室的早期成果
开源·github
HelloGitHub18 小时前
《HelloGitHub》第 126 期
开源·github