最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Gitlab的旧git仓库迁移到新仓库且保留commit历史记录

Git crifan 482浏览 0评论
折腾:
【未解决】迁移Gitlab仓库的git代码到新的个人下面的独立的组和仓库
期间,先去想办法把旧仓库代码:
http://gitlab.xxx.corp.com/data/data_xxx
完全迁移到新仓库:
http://gitlab.xxx.corp.com/data_xxx
且最好保留之前历史commit记录。
先去看看 
new project
后,能否有选项支持,从现有仓库中导入(且保留commit历史记录)
New Project · GitLab
默认是 Blank project
切换到
Create from template
看看:
去试试:
【未解决】Gitlab中尝试用export和import实现git仓库的整体复制迁移
所以,算了,还是删除这个import的仓库吧:
【已解决】Gitlab中删除自己group下面的刚import但是空的仓库
删除后,再去:
【未解决】Gitlab中尝试通过Transfer project去整体迁移一个git仓库
再去试试:
【已解决】Gitlab中尝试用clone加mirror参数实现git仓库整体迁移且带历史提交日志
然后就可以继续后续动作了:
之前的代码仓库中,去更换remote的url
git remote set-url origin http://xxx:12310/data_xxx/appcrawler.git
结果,即可:
 xxx@xxx  ~/dev/xxx/crawler/appAutoCrawler/AppCrawler   master  git remote set-url origin http://xxx:12310/data_xxx/appcrawler.git
 xxx@xxx  ~/dev/xxx/crawler/appAutoCrawler/AppCrawler   master  git remote -vorigin  http://xxx:12310/data_xxx/appcrawler.git (fetch)
origin  http://xxx:12310/data_xxx/appcrawler.git (push)
那再去试试:改动文件,上传代码。
去上传试试
git add *
git commit -m "1. update readme"
git push
都是OK的:
且新仓库中也能看到刚刚的commit更新:
另外再去用同样方式处理另外一个git仓库:
继续迁移另外一个git仓库:
【记录】Gitlab中git仓库mitmdumpUrlSaver整体迁移到新git仓库且保留历史记录

转载请注明:在路上 » 【已解决】Gitlab的旧git仓库迁移到新仓库且保留commit历史记录

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.186 seconds, using 23.32MB memory