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 push --set-upstream origin master

五、将项目里的.git目录的所有分支镜像推送到远程仓库

git push --mirror http://gitlab.xxx.com/xxx/Pro...

猜你喜欢

转载自blog.csdn.net/hutuyaoniexi/article/details/127921695
今日推荐