国内用户加速访问开源项目
前言
国内进行GitHub clone,正常Linux用户的软件包安装,Python开源库pypi的使用,都会由于不稳定的网络环境使用体验极差 。
本文将解决:
- GitHub clone
- Linux软件包下载
- pypi 下载
- 常用Linux发行版下载
FastGit
FastGit 是一个对于 GitHub.com 的镜像加速器。目前处于测试(BETA)阶段。
官网:https://fastgit.org/
中文文档:https://doc.fastgit.org/zh-cn/
使用帮助:https://doc.fastgit.org/zh-cn/guide.html
clone
使用fastgit进行加速克隆(clone)操作仅需要将github.com 换为 hub.fastgit.io
使用示例:
git clone https://hub.fastgit.org/author/repo
对于push 也是相同的操作
Release&源码存档
# Release
# 假设下载链接为https://github.com/A/A/releases/download/1.0/1.0.tar.gz
wget https://download.fastgit.org/A/A/releases/download/1.0/1.0.tar.gz
# Codeload
# 假设下载链接为 https://hub.fastgit.org/A/A/archive/master.zip
# 或者 https://codeload.github.com/A/A/zip/master
wget https://download.fastgit.org/A/A/archive/master.zip
raw
将https://raw.githubusercontent.com/
改为 https://raw.fastgit.org/
即可
清华大学开源软件镜像站
清华大学开源软件镜像站是 清华大学
官方运行的镜像站
官网:https://mirrors.tuna.tsinghua.edu.cn/
pypi镜像
python第三方包pypi的镜像站,国内下载奇快
pypi 镜像每 5 分钟同步一次。
临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
# some-package为要安装的包名
设为默认
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Pycharm
在弹出的输入框中输入
https://pypi.tuna.tsinghua.edu.cn/simple
常见Linux发行版镜像
