Skip to content

Instantly share code, notes, and snippets.

@appwiz
Last active January 19, 2019 06:22
Show Gist options
  • Save appwiz/03bfe9b1fa7eb325a20a8a911b154f1c to your computer and use it in GitHub Desktop.
Save appwiz/03bfe9b1fa7eb325a20a8a911b154f1c to your computer and use it in GitHub Desktop.
Moving a repository from BitBucket to GitHub
# needs hub installed via brew install hub
# hub will prompt for github credentials once with optional mfa
# https://help.github.com/articles/importing-a-git-repository-using-the-command-line/
BITBUCKET_USERNAME=<>
GITHUB_USERNAME=<>
REPOSITORY_NAME=<>
git clone --bare git@bitbucket.org:$BITBUCKET_USERNAME/$REPOSITORY_NAME.git
cd $REPOSITORY_NAME
hub create -p
git push --mirror git@github.com:$GITHUB_USERNAME/$REPOSITORY_NAME.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment