GitHub克隆下载加速

前言

GitHub 国内克隆和下载 release 都比较慢,百度解决方案全网充斥改 hosts 的方案,个人试过并不靠谱,而且会经常失效。

终于偶然发现了比较靠谱的方案。

方法

加速地址:

名称 地址
fastgit.org https://doc.fastgit.org/
gitclone.com https://gitclone.com/
gitee https://gitee.com/mirrors
cnpmjs.org https://github.com.cnpmjs.org/

加速原理就是替换域名,通过镜像加速,可手动用上述任一地址替换克隆地址中的 https://github.com。也可直接利用 git 本身的配置来自动替换。

git 自动替换方法:

执行命令

git config --global url."https://hub.fastgit.org".insteadOf https://github.com

也可直接编辑 ~/.gitconfig 文件添加:

[url "https://hub.fastgit.org/"]
         insteadOf = https://github.com/

参考

https://blog.csdn.net/networken/article/details/105122778

posted @ 2020-12-10 17:52  wangbs95  阅读(612)  评论(0编辑  收藏  举报