Migrate only selected commits from gitlab repo to bitbucket repo

SJ Office July 7, 2021

Hello,

I have a doubt regarding migrating only a couple of commits from gitlab to bitbucket.

I have already migrated the entire project repo from gitlab to bitbucket.

But later a colleague of mine added some commits in gitlab which now needs to be moved to bitbucket.

How do I migrate only selected commits from gitlab to bitbucket ?

Thanks.

SJ

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 8, 2021

Hi, @SJ Office! Welcome to the community! 

It’s not possible to migrate only selected commits from GitLab to Bitbucket. However, you can give this user access to the repository on Bitbucket, this way they can commit the changes to the new repository. So, this is what I would suggest:

  • Give this user access to the repository on Bitbucket;

  • Ask them to change the remote URL on their local repository by running the following command:

git remote set-url origin {new URL here}
  • Ask them to run the following command to make sure they have set the correct remote repository: 
git remote -v
  • Ask them to check out those commits to a brand new branch and only push that branch to the remote repository; 

  • Then, they can use a Pull Request to merge the changes into the main branch on the Bitbucket repository; 

  • This will assure that they do not introduce conflicts and do not do a force push that could potentially cause damage to the new data on Bitbucket. 

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events