gitlab的仓库迁移到新的gitlab

混江龙づ霸主 提交于 2019-12-16 12:13:08

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

下载原有gitlab源码
git clone http://gitlab.**.com/projectName
gitlab地址替换成为新gitlab地址
git remote set-url origin http://gitlab.**.com/newProjectName
本地推送到远程-可以在sourceTree中进行推送
git push origin --all 推送主干和分支
git push --tags 推送标签
查看远程gitlab地址
git remote -v
master版本回退
将master分支移除protected分支
git reset --hard 版本号 或者 sourceTree选择’将master重置到本次提交’,选择‘强行合并’
git push -u origin master -f
还可以通过镜像的方式迁移

克隆老项目的镜像
git clone --mirror old.git (old.git 为老项目的git地址)
进入项目目录
cd old.git
老项目的地址替换成新项目
git remote set-url --push origin new.git (new.git 为新项目的git地址)
将镜像推到远程
--------------------- 
作者:小乔FEer 
来源:CSDN 
原文:https://blog.csdn.net/oucqsy/article/details/86617172 
版权声明:本文为博主原创文章,转载请附上博文链接!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!