Mike Roberts
Posted on April 17, 2020
- Your repositories are Mercurial based (
hg
) stored on Bitbucket. - You've known the EOL date (June 1, 2020) has been coming for 2 years but put off converting your repos to
git
for all the reasons. - You know about @frej's https://github.com/frej/fast-export and all the gotchas: See here for the best guide I've seen on this
- You are wondering... surely is has to be easier than this?
I got you.
Easy conversion
Step 1: Import your repository to Github
If you're happy to switch to Github, congrats, you're done.
Step 2: Import your newly converted repo into Bitbucket
When you've done this, all of your existing author records will be the same as they were before. This is warts and all. One upside to using frej/fast-export
is the opportunity to clean things up a little bit.
Gotchas
- Github won't keep your closed branches around. For some this will be a blessing. Others not so much.
- If you import to Github and stop there you may need to do some manual work to attribute your repo authors to Github users. You can do this at any time though and it's simple to do. Here's the docs.
- There is no bulk UI import tool - this is one at a time, baby.
- If you use 2FA on Github you may need to generate a personal access token in place of your Github password.
- But what about comments on commits in Bitbucket / pull requests? They won't travel with you but Rarified has got you covered. See their scripts here to backup metadata from Bitbucket.
- Disclaimer: Every repository has a history and some will be cleaner than others. As such your mileage with this method may vary. I do recommend trialling both and deciding which is best for you.
Good luck and let me know how you go!
Mike
💖 💪 🙅 🚩
Mike Roberts
Posted on April 17, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.