Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate from bitbucket to GitLab

I have multiple repositories in BitBucket. What is the most appropriate way to migrate from BitBucket to GitLab?

For an example, I maintain a repo on my system named "SSSP". What should be my steps to have a clean migration of that repository from BitBucket to GitLab?

like image 387
letsBeePolite Avatar asked Apr 16 '16 04:04

letsBeePolite


People also ask

How do I move Bitbucket from Bitbucket to repository?

From the repository you want to transfer, click Repository settings in the left menu. On the Repository details page, click Manage repository located at the top-right corner of the screen. Click Transfer repository. Enter the Workspace ID of the workspace in which you want to transfer the repository.

Why people are moving from Bitbucket to GitHub?

No Two Factor Auth (This is no longer the case, Bitbucket supports Two Factor Auth) GitHub UI is more intuitive to navigate and work with. GitHub issues are much more powerful (labels, milestones) GitHub PR's are much nicer (Split diffs, less cluttered UI, Status API is cleaner)


1 Answers

It is better to use an intermediate local bare repo in order to duplicate one remote repo and push it to a new remote one.

Assuming you have an empty gitlab repo ready:

git clone --bare [email protected]:old/old_repo.git
cd old_repo
git remote add new-origin [email protected]:new/new_repo.git
git push --mirror new-origin
cd ..
git clone [email protected]:new/new_repo.git repo
cd repo
# start working

Note that this won't include the wiki (which you need to clone as well if you have some content there), or the issues.

like image 125
VonC Avatar answered Oct 05 '22 21:10

VonC