解决 github 网站 git push 或者 git clone 代码速度太慢

文章目录

  • [解决 github 网站 git push 或者 git clone 代码速度太慢](#解决 github 网站 git push 或者 git clone 代码速度太慢)
      • [1、获取 global.ssl.fastly 地址](#1、获取 global.ssl.fastly 地址)
      • [2、获取 global.ssl.fastly 地址](#2、获取 global.ssl.fastly 地址)
      • [3、修改 hosts 映射](#3、修改 hosts 映射)
      • [4、刷新系统 DNS](#4、刷新系统 DNS)

解决 github 网站 git push 或者 git clone 代码速度太慢

工作中往往需要从 github 上 clone 别人的代码或者 Push 代码,如果特别慢或者根本连接不上!有个修改 hosts 的方法,不完全保证,可以试试!

1、获取 global.ssl.fastly 地址

访问 http://github.global.ssl.fastly.net.ipaddress.com/#ipinfo,获取 cdn 域名以及 IP Address

2、获取 global.ssl.fastly 地址

访问 http://github.com.ipaddress.com/#ipinfo,获取 cdn 域名以及 IP Address

3、修改 hosts 映射

javascript 复制代码
  // Windows路径:
  C:\Windows\System32\drivers\etc\hosts
  // 文件末尾添加
  #github related website
  199.232.69.194 http://github.global.ssl.fastly.net
  140.82.113.4 http://github.com

  // Linux环境:
  sudo vim /etc/hosts
  #github related website
  199.232.69.194 http://github.global.ssl.fastly.net
  140.82.113.4 http://github.com

4、刷新系统 DNS

javascript 复制代码
  // Windows执行命令:
  ipconfig /flushdns

  // Linux执行命令
  /etc/init.d/networking restart

相关推荐
撸码猿5 小时前
1Password 后端被入侵:密码库为什么没被拿走
网络安全·github·供应链安全·钓鱼·1password
一条Go5 小时前
26 篇之后:Alioth 的 26 个设计决定
后端·github
一条Go5 小时前
开源新生代雷达 · 第 25 期
github
钱栈up9 小时前
GitHub热榜上手|Claude Code Game Studios:49个AI代理的独立游戏工作室
开源·github·shell
Haooog16 小时前
OpenHands 定时任务同步后还是关着?先查 Git Sync 的启停开关
git·agent·定时任务·配置管理·openhands
wflynn1 天前
GitHub 日榜趋势速报 | 2026-11-27
开源·github
一条Go1 天前
全链路 e2e:一次跑出 20 个现象,收敛成 5 个根因
后端·github·测试
一条Go1 天前
开源新生代雷达 · 第 24 期
github
钱栈up1 天前
GitHub 热榜上手|anthropics/skills:18.9万星的 Claude 技能库
python·开源·github
崖边看雾2 天前
Git 手册:三区、分支、撤销、冲突与团队协作
大数据·git·elasticsearch