How to move git repository with all branches from bitbucket to github?

It’s very simple.

Create a new empty repository in GitHub (without readme or licesne, you can add them before) and the following screen will show

Inside to import code option you paste your bitbucket URL’s repo and voilà!!

You can refer to the GitHub page “Duplicating a repository

It uses:

That would give:

git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository

cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored
# Set the push location to your mirror

git push --mirror

Refer: https://stackoverflow.com/questions/22906917/how-to-move-git-repository-with-all-branches-from-bitbucket-to-github/26702623#26702623