git仓库完整迁移

382 阅读1分钟

1 镜像clone老仓库

git clone <upstream-repo-url/repo.git> --mirror

2 创建一个新的空仓库

3 将镜像push到新的仓库

git remote add <your-remote-name> <your-remote-url/repo.git>
git push <your-remote-name> --mirror

参考链接

zhuanlan.zhihu.com/p/258961962

stackoverflow.com/questions/3…