1.拉旧仓库代码
git clone --bare 旧的git地址
会在当前目录下产生一个 xxx.git 的文件夹
2.推送到新仓库地址
cd xxx.git
git push --mirror 新的git地址
3.使用新仓库克隆代码
git clone 新的git地址
参考博客:Git仓库完整迁移
1.拉旧仓库代码
git clone --bare 旧的git地址
会在当前目录下产生一个 xxx.git 的文件夹
2.推送到新仓库地址
cd xxx.git
git push --mirror 新的git地址
3.使用新仓库克隆代码
git clone 新的git地址
参考博客:Git仓库完整迁移