bitbucketにプライベートリポジトリつくって開発してたけど、公開したくなったときにやった手順。
1.--mirrorオプションでclone
git clone --mirror https://bitbucket.org/username/repository-to-mirror.git
2.githubにリポジトリを用意
もし作ってない場合は作成しておく必要あり。
3.remote set-urlで移動先のリポジトリと指定
cd repository-to-mirror.git
で移動したら、remote urlを設定
git remote set-url --push origin https://github.com/username/mirrored
4.最後に--mirrorをつけてpush
username/passwordが聞かれたらgithubアカウントのものを入力すればOK。
git push --mirror
思ったより簡単。
参考
Duplicating a repository - User Documentation
How to move git repository with all branches from bitbucket to github? - Stack Overflow