git 项目迁移保留历史记录

第一步,新建仓库并复制仓库地址

例如:http://gitlab.xxx.com/xxx/Pro…

第二步,删除需要迁移的本地项目所关联的远程仓库地址

git remote remove origin

第三步,关联新仓库的地址

git remote add origin http://gitlab.xxx.com/xxx/Pro…

第四步,把项目推送到新的远程仓库

git push origin

另一种方式未验证:

可以从原仓库地址克隆一份裸版本库(.git)
git clone –bare http://github.com/xxx/project…

最后一步,将项目里的.git目录的所有分支镜像推送到远程仓库

git push –mirror http://gitlab.xxx.com/xxx/Pro…

You May Also Like

About the Author: daidai5771

发表评论

电子邮件地址不会被公开。 必填项已用*标注