git仓库迁移方案

1.去老仓库通过git clone --bare 老项目.git地址(它是一个空服务项目),如下图

git clone --bare [email protected]:developteam/backend/spring-cloud/saas-platform.git

git仓库迁移方案

2.进去刚才bare的目录,也就是上面的图,执行

cd saas-platform.git/
git push --mirror [email protected]:developteam/backend/spring-cloud/business/gateway.git

3.这时候去gitlab上gateway里就有东西了(包含历史提交记录)

4.去其他目录(项目需要建的目录,我这里在上一层也就是ideaproject)

cd ..
git clone [email protected]:developteam/backend/spring-cloud/business/gateway.git