Whenever possible, use GH's "Import repository" feature.
The import feature doesn't always work, though. In my experience, I tried to import a repo and it failed with a generic message. I had to contact GH support to ask for help. They told me my repo had a large file (>100MB), which couldn't be added to GH directly. I had to either remove the file or store it in GH LFS. In this case, one of the CLI methods below are needed:
- See: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
- See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
$ # create a new public repo "tarfu/fubar" on Github
$ git clone https://bitbucket.org/tarfu/fubar.git
$ cd fubar
$ git remote add https://github.com/tarfu/fubar.git
$ git push upstream master; git push upstream develop; # add more branch pushes as necessary
$ git push --tags upstream
ℹ️ Note: This method uses --mirror
to copy all branches, tags, etc.
$ git clone --mirror https://bitbucket.org/aiida_team/aiida_core.git
$ cd aiida_core.git
$ git remote set-url --push origin [email protected]:giovannipizzi/aiida_core_test.git
$ git push --mirror