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

相关推荐
笨鸟先飞,勤能补拙35 分钟前
密码学深度指南 — SecOps 工程师实战手册
人工智能·vscode·python·安全·github·密码学·visual studio
TunerT_TQ1 小时前
Valhalla 静态工程审阅 #004|MoonshotAI MoonEP 源码证据驱动评测【大厂开源基础设施特辑】
架构·github
Coder-LiyG1 小时前
Git 常用操作指南:从初始化到回退的高频命令速查
git
Eloudy12 小时前
git format-patch 、git diff 与 git apply
git·构建
技术小结-李爽13 小时前
【工具】git安装及配置
git
0xR3lativ1ty15 小时前
每日GitHub trending精选
github
带娃的IT创业者15 小时前
GitHub 热门项目解析:当 AI 编码助手遭遇“上下文爆炸”
人工智能·github·代码优化·ai编程助手·上下文窗口·上下文压缩
白鲸开源18 小时前
Apache SeaTunnel 提交一个任务都经过了什么?
大数据·开源·github
dong_junshuai18 小时前
每天一个开源项目#60 TencentDB Agent Memory:1.4万星的团队记忆中枢
github·腾讯
dong_junshuai18 小时前
每天一个开源项目#61 3.9K Stars:Cloudflare 给 Agent 一台持久云电脑
程序员·github