前端有道 前端有道
导航
算法
开发
  • Git

    • Git导读
  • 收藏夹 (opens new window)
  • 工具库 (opens new window)
  • netlify Vuepress (opens new window)
  • vercel Vuepress (opens new window)
  • Vuepress2.0 (opens new window)
  • netlify Vuepress2.0 (opens new window)
留言区
娱乐
关于
  • 时间轴
  • 标签
  • 分类

星野

给岁月以文明
导航
算法
开发
  • Git

    • Git导读
  • 收藏夹 (opens new window)
  • 工具库 (opens new window)
  • netlify Vuepress (opens new window)
  • vercel Vuepress (opens new window)
  • Vuepress2.0 (opens new window)
  • netlify Vuepress2.0 (opens new window)
留言区
娱乐
关于
  • 时间轴
  • 标签
  • 分类
  • 浏览器

  • Git

  • Mac

  • VSCode

  • GitHub

    • 2022提高国内访问 Github 速度的 5 种方法!
      • 前言
        • MuaCloud 机场
        • 利用第三方镜像下载
        • 通过代理网站下载
        • Gitee中转fork仓库下载
        • 修改Hosts文件进行加速
    • GitHub+jsDelivr+PicGo打造免费图床
    • GitHub仓库下载慢几种解决办法
    • 使用GitHub自建免费小型图床
  • 工具
  • GitHub
星野
2021-02-28
0
目录

2022提高国内访问 Github 速度的 5 种方法!

# 2022提高国内访问 Github 速度的 5 种方法!

# 前言

  • MuaCloud 机场
  • 利用第三方镜像下载
  • 通过代理网站下载
  • Gitee中转fork仓库下载
  • 修改 HOSTS 文件进行加速

# MuaCloud 机场

MuaCloud 机场 (opens new window),注册账号,在商店购买套餐然后首页复制订阅地址导入Clash开启代理,访问Google (opens new window)测试是否成功。

教程 https://muacloud.live/user/tutorial?os=Windows&client=Clash (opens new window)

Clash工具

  • Clash Download 官网 (opens new window)

  • Clash for Windows 汉化版 (opens new window)

  • ClashX Pro for Mac

ClashX Pro 可开启增强模式下终端会走代理流量,克隆仓库、安装依赖包等可节省70%~90%时间,缺点可能影响到项目开发,添加忽略网站地址。

Windows用户可以借助Proxifier软件实现全局代理。

# 利用第三方镜像下载

第一种 安装油猴插件和脚本

  • 油猴插件 (opens new window)
  • Github 增强 - 高速下载 (opens new window)

为 Github 的 Git Clone、Release、Raw、Code(ZIP) 等文件添加 高速下载(加速下载)。

第二种 安装GitHub加速插件

  • GitHub加速 (opens new window)

提供Release、Code(ZIP) tag文件加速。

# 通过代理网站下载

Release、Code(ZIP) 文件加速:

  • https://gh.api.99988866.xyz
  • https://github.rc1844.workers.dev
  • https://ghgo.feizhuqwq.workers.dev
  • https://git.yumenaka.net
  • https://github.com.cnpmjs.org
  • https://mirror.ghproxy.com/
  • https://ghproxy.com/
  • https://toolwa.com/github/

Git Clone 加速:

  • https://github.do
  • https://gitclone.com
  • https://hub.fastgit.xyz
  • https://ghproxy.com
  • https://hub.0z.gs

具体哪个速度快,请自行找一些大文件来测速。

# Gitee中转fork仓库下载

访问 gitee 网站并登录,在顶部选择“从GitHub/GitLab 导入仓库” 如下

在页面中粘贴你的Github仓库地址,点击导入即可

导入成功,git clone仓库,下载速度可以达到2MB/s,就是有点费事。

# 修改Hosts文件进行加速

自从 2021.3 月初某会开始,很多地区已经间歇性无法访问 Github 了。 这种情况无论是改 DNS 还是改 Hosts 都没用,因为对 Github 域名 SNI 干扰/封锁,任意 IP 指向 Github 去访问时,该 IP 的 443 端口就会超时 3 分钟! 因为是随机干扰的,所以有时候会碰到 “短暂” 可用的 IP

有兴趣可以看看这篇详细讲解分析的文章:https://www.v2ex.com/t/758568 (opens new window)

所以修改HOSTS文件进行加速方法是否还有效,可以自测。 下载修改HOSTS小工具

  • SwitchHosts -修改HOSTS小工具 (opens new window)

定时同步

添加一条规则:

  • 方案名:GitHub
  • 类型:远程
  • URL 地址:https://gitee.com/ineo6/hosts/raw/master/hosts
  • 自动更新:1个小时

刷新DNS缓存

打开终端,输入对应命令

// Mac用户
sudo killall -HUP mDNSResponder

// Win
ipconfig /flushdns

原文地址:https://github.com/ineo6/hosts

有兴趣可以阅读文章SwitchHosts! 还能这样管理 hosts (opens new window),后悔没早点用 了解详情,里面有介绍以及各个平台刷新 DNS 缓存的方法。

参考

  • https://github.com/ineo6/hosts
  • https://www.beiwangshan.com/205.html
  • https://greasyfork.org/zh-CN/scripts/412245-github-%E5%A2%9E%E5%BC%BA-%E9%AB%98%E9%80%9F%E4%B8%8B%E8%BD%BD
上次更新: 2022/05/11, 15:37:12
VSCode所有的默认配置项介绍
GitHub+jsDelivr+PicGo打造免费图床

← VSCode所有的默认配置项介绍 GitHub+jsDelivr+PicGo打造免费图床→

最近更新
01
图解Git
05-10
02
关于 - 网站错误反馈
05-10
03
关于 - 赞赏❤️的用途
05-10
更多文章>
加入前端有道交流群 | Copyright © 2018-2025 星野 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式