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查询即可

亲测有效

相关推荐
大卫小东(Sheldon)3 小时前
GIM 2.0 发布:真正让 AI 提交消息可定制、可控、可项目级优化
git·rust·gim
知识即是力量ol6 小时前
研发实战:Git 规范化开发全流程指南
git·gitee·github
我是一只代码狗6 小时前
idea创建分支
git
知识即是力量ol8 小时前
Git 快速入门 (实习生视角)
git·gitee·github
Dontla8 小时前
Git撤销上一次提交(撤销提交,Git回退提交)git reset、git revert
git
wdfk_prog9 小时前
解决 `git cherry-pick` 引入大量新文件的问题
大数据·git·elasticsearch
fu的博客11 小时前
Git从删库到跑路
git·gitee·github
要加油哦~11 小时前
git 报错 | husky - pre-commit hook exited with code 1 解决
git
知识即是力量ol11 小时前
Git 实战指南:从分支管理到冲突解决
git·github·源代码管理
基于底层的菜鸟11 小时前
如何在VS code中为GitHub Copilot 添加SKill
github