目录

Git 备份仓库(mirror)

参考资料: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/duplicating-a-repository

1. 以 mirror 的方式 clone 仓库

git clone --mirror https://github.com/exampleuser/repository-to-mirror.git

2. 设置目标地址

cd repository-to-mirror
git remote add mirror_host https://github.com/exampleuser/mirrored

3. 更新并同步到目标地址

git fetch -p origin
git push --mirror mirror_host