关于git:Git-clone加速镜像工具-wogit

1次阅读

共计 1053 个字符,预计需要花费 3 分钟才能阅读完成。

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
正文完
 0