Skip to content

Instantly share code, notes, and snippets.

@ugate
Last active March 20, 2020 17:47
Show Gist options
  • Save ugate/dfebf1ee74df0c93fbc474e3b82dada1 to your computer and use it in GitHub Desktop.
Save ugate/dfebf1ee74df0c93fbc474e3b82dada1 to your computer and use it in GitHub Desktop.
Migrate repositories from GitHub to Bitbucket
# Clone the Github repository
git clone --mirror https://github.com/<YOUR GITHUB ACCT>/<YOUR GITHUB REPO NAME>.git
# Change working directory to the newly created repo dir
cd <YOUR REPO NAME>.git
# Set the URL to the new repo origin
git remote set-url --push origin https://<YOUR BITBUCKET ACCT>@bitbucket.org/<YOUR BITBUCKET USER OR ORG>/<YOUR BITBUCKET REPO NAME>
# Push the mirror to the Bitbucket repo (should prompt you for your Bitbucket credentials in popup)
git push --mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment