gitlab的仓库迁移到新的gitlab

下载原有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

克隆老项目的镜像
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 
版权声明:本文为博主原创文章,转载请附上博文连接!gitlab

相关文章
相关标签/搜索