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

This widget could not be displayed.

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
Published Monday in Teamwork

The tools we make for teams? We use them every day at Atlassian to get shit done (and it works).

I’m Jess, a Product Marketer for Jira Software Server and Data Center, and now a huge fan of our products. Read on for a 90 day, new-hire perspective on what it’s like to standardize on the Atlassian...

35 views 0 3
Read article

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