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

相关推荐
guwentian5 小时前
Git Worktree 实战:用并行多 Agent 把开发提速 N 倍
大数据·git·elasticsearch·wroktree
不吃鱼的羊8 小时前
Git识别未修改的文件有修改
git
Shell运维手记8 小时前
Linux 常用基础命令学习笔记
linux·运维·笔记·学习·算法·github
码流怪侠9 小时前
StereoCrafter 源码级深度拆解:腾讯如何把 2D 视频“抠“成 3D
github·音视频开发·webvr
像风一样自由202010 小时前
加强版VScode结合remote-ssh远程连接服务器开发指南
服务器·vscode·ssh
蓝黑墨水10 小时前
一个git问题的处理
git
fthux13 小时前
不必下载整个仓库:GitZip Pro 让 GitHub 文件与文件夹批量下载更简单
前端·chrome·ai·edge·开源·github·firefox
互联网中的一颗神经元13 小时前
21 — 额外命令:同时开两个窗口、自动检查哨
git
_道隐_16 小时前
git stash save 和 git stash push有什么区别?
git
人工智能研究所17 小时前
GitHub 10k+ Star:用自然语言描述系统,AI 帮你生成可交互架构图
人工智能·github·交互·自然语言·系统架构图·archify