今天有机会尝试了一下gitlab 上的 repository 迁移。步骤如下
-
将代码从原来的repo 克隆到本地
git clone ssh://git@git.xx.net:18022/cplm/aps-kitchen.git -
进入到要迁移的branch
git checkout test -
清除原始repo link
git remote rm origin -
增加新的repo link
git remote add origin ssh://git@git.xxx.net:18022/APS-AI/xxx.git -
强制将本地代码推到线上
git push -f --set-upstream origin test:test