老倉庫所有分支都完整拉取
git clone --mirror 原倉庫地址
文件名:xxx.git
進入下載的目錄,設置新的倉庫地址
git remote set-url origin 新倉庫地址
推送到新倉庫
git push -f origin --mirror
問題一:remote: GitLab: The default branch of a project cannot be deleted.
去掉默認分支保護,推送完再完原回來
如果還不行,可能是因為舊得倉庫默認分支是master,而gitlab默認得分支是main(鬼佬逼事多,覺得master有侮辱黑人的嫌疑)
解決:新的倉庫建立master分支,再把默認分支給到master,重新推送