windows下git pull超时,ping不通github

报错

ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

解决办法

修改hosts

最后加一行,文件位置:C:\Windows\System32\drivers\etc\hosts

java 复制代码
140.82.113.3 github.com
注意

github的IP地址可能会变,去ipaddress.com查询即可

亲测有效

相关推荐
醇氧8 小时前
【git】WARNING: connection is not using a post-quantum key exchange algorithm.
git
一只程序熊9 小时前
Git不常用操作记录
git
通义灵码10 小时前
Qoder 支持通过 DeepLink 添加 MCP Server
人工智能·github·mcp
小龙10 小时前
【Git 报错解决】 远程仓库 origin 已存在(`remote origin already exists`)
git·报错
数据大魔方14 小时前
【期货量化实战】跨期套利策略:价差交易完整指南(TqSdk源码详解)
数据库·python·算法·github·程序员创富
数据大魔方15 小时前
【期货量化实战】螺纹钢量化交易指南:品种特性与策略实战(TqSdk完整方案)
python·算法·github·程序员创富·期货程序化·期货量化·交易策略实战
Cx330❀17 小时前
Git 多人协作全攻略:从入门到高效协同
大数据·elasticsearch·搜索引擎·gitee·github·全文检索·gitcode
BORN(^-^)18 小时前
Git 操作概要
git
CoderJia程序员甲19 小时前
GitHub 热榜项目 - 日榜(2026-1-9)
开源·大模型·llm·github·ai教程
bigHead-21 小时前
Git合并操作详解:安全高效地合并远程分支
git·安全·elasticsearch