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

相关推荐
其实防守也摸鱼3 小时前
教育信息技术应用创新---基础软件信息赛
运维·服务器·数据库·github·copilot
Patrick_Wilson3 小时前
为什么gitlab的MR会默认有一个merge commit
前端·git·gitlab
是乐乐啊呀4 小时前
版本控制 GIT 和 SVN
git·svn
与自己和解7414 小时前
使用ssh实现 VScode 直连 ubuntu
vscode·ubuntu·ssh
0xR3lativ1ty6 小时前
AI本地部署工具火热趋势
github
夜鸣笙笙7 小时前
Git详细安装流程
git
LlmCraft|大模型工程实践7 小时前
14. CI/CD 流水线中集成 Docker:GitHub Actions 自动构建部署
ci/cd·docker·github
hulihutu447 小时前
拒绝延期、bug、货不对板:2026 管理系统定制开发落地保障手册
github·bug·鸿蒙系统·数据库管理员
隔窗听雨眠8 小时前
活动中台系统慢SQL治理实践:从监控告警到性能优化的全链路方法论
sql·性能优化·github
m4Rk_8 小时前
【论文阅读】Agent 记忆机制(60):MemInsight——让 LLM 自动为历史记忆生成语义索引
论文阅读·人工智能·学习·开源·github