一个简单的 Git 仓库镜像工具,用于克隆源仓库并同步所有分支和标签到目标仓库。使用 Deno 实现,无需 Node.js 依赖。
-
安装 Deno
-
运行脚本(需要允许运行子进程):
deno run --allow-run index.ts --from=https://example.com/source.git --to=https://example.com/target.git
--from
: 源仓库的 URL--to
: 目标仓库的 URL
- 自动克隆源仓库
- 同步所有远程分支
- 同步所有标签
- 自动清理临时文件
- 无需 package.json、tsconfig.json、node_modules
- 需要本地已安装 git
- 使用临时目录进行克隆和同步操作