由于目前使用的 Git 仓库即将无法使用,需要将仓库代码迁移到新的 Git 仓库。具体操作方法如下:1.登录新的仓库,然后创建仓库。创建后,新仓库地址: http://gitlab.your-new-domain.com/project.git2.克隆旧仓库镜像到本地:
1
2
3
|
git clone --mirror http://gitlab.your-old-domain.com/project.git
# 如果仅需要克隆 Branch 和 Tag,可以使用 --bare 参数替换 --mirror。
cd project.git
|
3.推送镜像到新仓库
1
2
|
git remote set-url --push origin http://gitlab.your-new-domain.com/project.git
git push --mirror
|
tips:更新当前目录下全部仓库fetch_all.sh
1
|
for d in ./*/ ; do (cd "$d" && git fetch); done
|
打包当前目录下全部仓库tar_all.sh
1
|
ls |xargs -i tar zcvf {}.tar.gz {}
|