【Linux简单实用小命令034】GitHub下载提速百倍的方法

Scroll Down

替换https://github.comhttps://github.com.cnpmjs.org

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

原理是被墙的只是github这个域名,仓库包github.com.cnpmjs.org并没有限制。全局替换域名就行了。

替换前下载速度

[root@yaomm deploy]# git clone https://github.com/jaywcjlove/linux-command.git
Cloning into 'linux-command'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
^Cceiving objects:   2% (1380/61583), 2.31 MiB | 19.00 KiB/s    

替换后下载速度

[root@yaomm deploy]# git clone https://github.com/jaywcjlove/linux-command.git
Cloning into 'linux-command'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 61583 (delta 3), reused 2 (delta 0), pack-reused 61575
Receiving objects: 100% (61583/61583), 141.13 MiB | 7.68 MiB/s, done.
Resolving deltas: 100% (59400/59400), done.
[root@yaomm deploy]# 

如果不全局替换,也可以在下载链接里直接替换

git clone https://github.com.cnpmjs.org/jaywcjlove/linux-command.git