Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import gitlab repository to bitbucket Repository

I have a gitlab Repository and I want it to update it on the bitbucket account.

Please provide me steps to follow, so that it can be helpful to me to migrate it in bitbucket from Gitlab.

like image 529
Anubhav Avatar asked May 22 '17 06:05

Anubhav


People also ask

Can GitLab work with Bitbucket?

GitLab CI/CD can be used with Bitbucket Cloud by: Creating a CI/CD project. Connecting your Git repository via URL.

How do I move a repository to Bitbucket?

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.

What does import repository do in Bitbucket?

If you've got files to add that have never been part of a repository, see Add unversioned code to a repository. To get your existing code into Bitbucket Cloud quickly from another hosting site or system, Bitbucket provides an importer to grab a repository.


2 Answers

1) Create the repository in Bitbucket using the UI

2) Clone the Gitlab repository using the "--bare" option

git clone --bare GITLAB-URL

3) Add the Bitbucket remote

cd REPO-NAME
git remote add bitbucket BITBUCKET-URL

4) Push all commits, branches and tags to Bitbucket

git push --all bitbucket
git push --tags bitbucket

5) Remove the temp repository

cd ..
rm -rf REPO-NAME
like image 129
Marcelo Ávila de Oliveira Avatar answered Oct 06 '22 05:10

Marcelo Ávila de Oliveira


Follow these steps:

  1. Create a new repo in bitbucket.
  2. git clone <gitlabRepoUrl>
  3. cd <repoName>
  4. git remote add bitbucket <bitbucketRepoUrl>
  5. git push bitbucket master
like image 33
Bishakh Ghosh Avatar answered Oct 06 '22 05:10

Bishakh Ghosh