【解决方法】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

相关推荐
m0_6948455711 小时前
tinylisp 是什么?超轻量 Lisp 解释器编译与运行教程
服务器·开发语言·云计算·github·lisp
June`11 小时前
muduo项目排查错误+测试
linux·c++·github·muduo网络库
春日见11 小时前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
weixin_66813 小时前
GitHub 2026年AI项目详细数据汇总表-AI分析-分享
人工智能·github
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
stevenzqzq1 天前
git 常用操作
大数据·git
weixin_6681 天前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
Curvatureflight1 天前
Git工作流最佳实践:从混乱到优雅
git
MicrosoftReactor1 天前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github