Git clone加速镜像工具 wogit

码农天地 -
Git clone加速镜像工具 wogit
Git clone加速镜像工具 wogit

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

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

安装
npm i wogit -g
使用

与git一致,基本是把git替换成wogit即可

# from
git clone https://github.com/chalk/chalk.git

# ti
wogit clone https://github.com/chalk/chalk.git

# 其他参数不变,跟使用git一样,如
wogit clone https://github.com/chalk/chalk.git --depth=1
镜像切换

wogit默认使用cnpmjs镜像,使用 wogit -h 可以随时查看镜像切换的选项

➜ wogit -h
Usage: 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 -fa
wogit clone https://github.com/chalk/chalk.git --fastgit

# gitee镜像
wogit clone https://github.com/chalk/chalk.git -ge
wogit clone https://github.com/chalk/chalk.git -gitee

# 其他不一而足

说明:并非所有的仓库都有加速镜像,请根据提示,确认是否需要使用-gh强制直接使用github。

这次一定

如果觉得有用,可以到 github仓库 star支持,感谢。

说明

wogit只会在 操作为clone且远程为github仓库时才会使用加速的源 ,其他情况是透传的,因此clone外的其他操作也是支持的,可以替代git作为日常使用。

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

? 如果无法接受这多出来的两个字母,可以自行配置alias,这个就不细说了。示例如下

alias wo=wogit
特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。
上一篇: git 问题记录

Tags 标签

加个好友,技术交流

1628738909466805.jpg