Migrating GitHub to Bitbucket Server, forked repos Edited

Hello,

I am working on moving many repositories from our GitHub instances to Bitbucket Server.

We have a main organization that our other orgs fork from in GitHub. I am moving all of these repositories over, but need to keep this forked relationship between the repos. Is this a possibility?

Bitucket Server: v4.13.0

Thanks!

1 answer

1 accepted

1 vote
Accepted answer

Found a manual solution. Adding it here in case anyone ever runs into this. This method can work from any Git source, not just GitHub to Bitbucket.

  1. Clone the main repo from GitHub using --bare. (git clone --bare [repoURL])
  2. Clone the forked repo from GitHub using --bare. (git clone --bare [repoforkURL])
  3. Create a new repo in Bitbucket for the main repo.
  4. Clone the new repo from Bitbucket.
  5. Commit and Push a dummy file to the main repo in Bitbucket (I chose to use do a readme file)
  6. In Bitbucket, fork the main repo to whichever project you want the fork to exist.
  7. Add a remote for the Bitbucket main repo to the bare repo from Step 1. (git remote add [repoURL])
  8. Push all the repo data to the Bitbucket main repo. (git push --all bitbucket) (git push --tags bitbucket)
  9. Add a remote for the Bitbucket forked repo to the bare repo from Step 2. (git remote add [repoURL])
  10. Push all the repo data to the Bitbucket forked repo. (git push --all bitbucket) (git push --tags bitbucket)

Note: You may see some conflicts when pushing to the repos. Use --force to overwrite the dummy file added in Step 5.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Dec 07, 2018 in Off-topic

Friday Fun: Dry T-Shirt Competition - What's your BEST (Atlassian) T-Shirt!?

[Note: So it was my turn for Friday Fun and sadly I was sick thanks to rubbish sinus infection... so apologies to most of Europe and Asia for the delayed post. However, I finally got out of bed for t...

362 views 27 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you