| 用途 | 仓库迁移、镜像与冷备份 |
|---|---|
| 产物 | 裸仓库 + refs/* 全量引用 |
| 推送 | git push --mirror <目标> |
常用示例
常用示例
git clone --mirror git@example.com:team/repo.git repo-mirror.git
cd repo-mirror.git
git push --mirror git@example.com:team/newrepo.git
git show-ref | wc -l镜像仓库包含 refs/remotes 等全部引用,推送到目标前确认目标库是否允许覆盖;refs/pull 类临时引用可能一并带上。