镜像源设置

Github

手动替换

原始:

1
git clone https://github.com/aaa/bbb.git

替换后:

1
git clone https://gitclone.com/github.com/aaa/bbb.git

使用命令进行全局替换

1
git config --global url."https://gitclone.com/".insteadOf https://

全局参数更改之后,可以使用 vim ~/.gitconfig 命令查看当前的配置文件,可以看到以下配置:

1
2
[url "https://url you choose"] 
insteadOf = https://github.com/

对 url 内部的内容进行替换可以更换镜像源,以下是可能可以用的镜像源:

1
2
3
4
5
6
7
8
https://github.com.cnpmjs.org
# 服务器位于香港

https://gitclone.com
# 服务器位于杭州

https://doc.fastgit.org
# 服务器位于香港

一般使用 https://gitclone.com 即可。