解决 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

相关推荐
likuolei7 小时前
Git 与 SVN 区别
git·svn
charlee4412 小时前
Git使用经验总结8-Git仓库历史记录清除
git·powershell·敏感信息·仓库重置·历史重写
正经教主13 小时前
【Git】Git05-04:Github分支管理与协作流程
git·github
sean90815 小时前
git filter-repo(优秀的 git repo 历史重写工具) 实战
git·repo·工具
hen3y15 小时前
清理 Git 代码库大文件历史记录
运维·git
CoderJia程序员甲15 小时前
GitHub 热榜项目 - 日榜(2025-11-22)
ai·开源·llm·github·ai教程
小Lu的开源日常16 小时前
踩坑日记:为什么Git 突然 Push 不上去了
git·ssh·github
LZ7工作室16 小时前
MAC编程:在MACOS安装和使用 Git 的方法
网络·git·macos·github·个人开发
T***160719 小时前
Git增强现实案例
git·ar
Arva .20 小时前
git常用
git