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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Agility Beta

We've moved!

A note to all watchers that we've moved to a new community home... https://community.atlassian.com/t5/Agility/ct-p/agility Please update your notification subscriptions to keep across the ...

95 views 1 2
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