Git clone减速镜像工具 wogit

wogit 是一个 git clone 镜像减速命令行工具,解决github仓库clone慢的问题。

wogit 通过封装和透传,除了几个镜像选项新参数,其余应用上与git统一,不仅仅能用来clone减速,代替 git 作为日常应用也是OK的。

装置

npm i wogit -g

应用

与git统一,根本是把git替换成wogit即可

# fromgit clone https://github.com/chalk/chalk.git# tiwogit clone https://github.com/chalk/chalk.git# 其余参数不变,跟应用git一样,如wogit clone https://github.com/chalk/chalk.git --depth=1

镜像切换

wogit默认应用cnpmjs镜像,应用 wogit -h 能够随时查看镜像切换的选项

➜ wogit -hUsage: wogit [options]Options:  -V, --version   output the version number  -cn --cnpm      cnpmjs镜像(默认)  -fa --fastgit   fastgit镜像  -ge --gitee     gitee镜像  -gc --gitclone  gitclone镜像  -gh --github    应用原始github镜像  -h, --help      display help for command

比方

# fastgit镜像wogit clone https://github.com/chalk/chalk.git -fawogit clone https://github.com/chalk/chalk.git --fastgit# gitee镜像wogit clone https://github.com/chalk/chalk.git -gewogit clone https://github.com/chalk/chalk.git -gitee# 其余不一而足

阐明:并非所有的仓库都有减速镜像,请依据提醒,确认是否须要应用-gh强制间接应用github。

这次肯定

如果感觉有用,能够到 github仓库 star反对,感激。

阐明

wogit只会在 操作为clone且近程为github仓库时才会应用减速的源 ,其余状况是透传的,因而clone外的其余操作也是反对的,能够代替git作为日常应用。

当然,wogit也有不好的中央——命令多了两个字母

???? 如果无奈承受这多进去的两个字母,能够自行配置alias,这个就不细说了。示例如下

alias wo=wogit