Skip to content

Instantly share code, notes, and snippets.

@givemelove
Created January 8, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save givemelove/1292e357a14b4808e82b8ea8fe80c54a to your computer and use it in GitHub Desktop.
Save givemelove/1292e357a14b4808e82b8ea8fe80c54a to your computer and use it in GitHub Desktop.
Instructions to migrate Bitbucket Repos to Github sequentially
# Pull up BitBucket and Github side by side
# The assumption is that you have git installed on your command line and are authenticated to both Bitbucket and Github.
# For Each bitbucket repo, do the following using the command line:
# 1 - Clones the Bitbucket repo to your working directory
# 2 - Change the working directory
# 3 - Rename the Bitbucket repo from origin to bitbucket & add the Github repo as the new Origin
# 4 - Push the repo to the Origin (Github), Remove the Bitbucket reference and leave the working directory
git clone git@bitbucket.org:<Bitbucket User>/<Repo>
cd <Repo>
git remote rename origin bitbucket && git remote add origin https://github.com/<Github User>/<Repo>
git push origin master && git remote rm bitbucket && cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment