Github加速下载笔记

前言: 有时git clone的速度只有十几KB/s, 太慢了, 所以搜索一些github加速下载的工具和资源, 整理如下

使用镜像

方法一
先将repo克隆到码云上, 克隆的速度比较快, 然后从码云上下载. 提高github下载速度的方法【100%有效】可达到2MB/s
方法二
使用镜像网址进行clone, 在项目原地址上加上 .cnpmjs.org ,使用 cnpm 的镜像来下载 git 项目, 举例如下:

原地址:git clone https://github.com/jhao104/proxy_pool.git
修改后:git clone https://github.com.cnpmjs.org/jhao104/proxy_pool.git

下载某些文件时, 有的域名并非 github.com 而是 raw.githubusercontent.com,这时可以使用 Static CDN提供的反代服务。只要将raw.githubusercontent.com替换为raw.staticdn.net即可. 举例如下:

原先是: wget https://raw.githubusercontent.com/jhao104/proxy_pool/master/test.py
修改为: wget https://raw.staticdn.net/jhao104/proxy_pool/master/test.py

参考: https://juejin.im/pin/6844910553467469838

使用代理

github clone慢由于某些访问的资源被qiang, 所以有代理的话, 使用代理会加速. 在命令行指定sock5代理的IP和PORT(已localhost和8080为例), 然后再进行clone.

export http_proxy=socks5://localhost:8080 https_proxy=socks5://localhost:8080
# 然后执行
git clone xxx

参考: https://segmentfault.com/a/1190000018813121

其他资源:
多种github加速下载的方法

猜你喜欢

转载自blog.csdn.net/feifei3211/article/details/108679018
今日推荐