GitHub 加速
目录
GitHub 加速
通过镜像网站访问 ★★★
- https://hub.fastgit.org -- 综合体验好一些
- https://github.com.cnpmjs.org/ -- 经常不能使用
网站的内容跟 GitHub 是完整同步的镜像。但存在一个严重的问题:经常被 GitHub 禁止访问!这时换几种姿势多试几次就可以了。
更适合用来访问 GitHub,下载的话不见得有多快。
通过码云 Gitee 中转 ★★★
- 访问 https://gitee.com/ 并登录,在顶部选择
从 GitHub/GitLab 导入仓库
- 在导入页面中粘贴你的 Github 仓库地址,点击导入即可
- 等待导入操作完成,然后在导入的仓库中下载浏览对应的该 GitHub 仓库代码,你也可以点击仓库顶部的
刷新
按钮进行 Github 代码仓库的同步 - 如果存在子项目,还需要查看项目
.gitmodules
文件,然后重复上面的步骤
使用浏览器插件下载 ★★
- Fast-GitHub
- Chrome 插件,FQ才能下载
依赖的是 gh-proxy,只是加速下载,没办法加速页面访问。
配置用户配置文件 (~/.ssh/config
)
Host github.com
HostName github.com
User git
IdentityFile 指定密钥认证使用的私钥文件路径
# 新增如下内容
Host git.zhlh6.cn
HostName git.zhlh6.cn
User git
IdentityFile 使用github.com的秘钥
修改 HOSTS 文件 ★★
- 去 https://www.ipaddress.com/ 查询如下三个域名对应的 IP 地址
GitHub.com
github.global.ssl.Fastly.net
codeload.github.com
- 修改
C:\Windows\System32\drivers\etc\hosts
文件- 修改文件权限:右击->hosts->属性->安全->编辑->点击Users->在Users的权限
写入
后面打勾->点击确定 - 添加映射关系
- 修改文件权限:右击->hosts->属性->安全->编辑->点击Users->在Users的权限
- 可能需要重启网络
140.82.114.3 github.com
199.232.69.194 github.global.ssl.fastly.net
140.82.114.10 codeload.github.com
注意:静态 IP 可能经常会发生变化
使用 GitClone 缓存加速 ★
最简单的使用方式:只需在 git clone 命令中将gitclone.com
嵌入到克隆地址中即可
git clone https://gitclone.com/github.com/baiqiantao/vuepressBlog.git # 方法一,替换当前 URL
git config --global url."https://gitclone.com/".insteadOf https:// # 方法二,全局设置 git
cgit clone https://github.com/baiqiantao/vuepressBlog.git # 方法三,使用 cgit 客户端
其他加速下载网站 ★
2016-06-14
本文来自博客园,作者:白乾涛,转载请注明原文链接:https://www.cnblogs.com/baiqiantao/p/5585345.html