Migrating a repo from BitBucket to GitHub
Some (a lot) of this is Ginkgo Street specific, but it does have some valuable generic info and concept oriented stuff.
Instructions for managing user access
- There is still some uncertainty about how we will use teams.
- I think we will use them on a per-client (not project) basis.
- So, before migrating or creating new repos, create a team for the client using the client-key (e.g. BACT).
- We can then manage access to the repos by adding members to the team.
- Other teams can also be added to teams, for instance if we have a contractor who has multiple developers it may be handy to create a team for that contractor (e.g. create a Tadpole team) and then add the contractor-team to the client-team for access.
The Basic Idea™
Think about whether or not to change the repo name/url. Since the URL is definitely changing, now is the best time to change the repo name to something meaningful. Prefixing with a client-key is not necessarily preferable, but it is one option to consider for renaming.
- Log into BitBucket and find the repo (good luck!)
- Go to the repo settings and set the repo to public
- Alternatively you can leave the BitBucket repo private and just "log in" to BitBucket in step #5 below
- Get the clone URL by clicking the Clone button in the upper-right of the BitBucket repo
- Go to GitHub and find "import" on the plus-icon in the upper-right corner
- There should be an "Import from URL" option, use that
- Confirm that shit worked
- Delete the BitBucket repo
- Update the remote config of any known/shared clones with the new URL and do a git fetch. This can be accomplished in one of three ways:
- Edit the URL in the
- Remove and re-add the remote, usually the origin:
git remote remove origin
git remote add origin [URL]
- Do a
git remote set-url origin [URL] (this might be the easiest/cleanest way, see the documentation here)
This page was last updated: 10-25-2019