Move from Github to Bitbucket - Method 1

Move from Github to Bitbucket - Method 1

If you want to move your repository from one hosting service provider to another, check out the method below to do it easily.

To move a repository from GitHub to Bitbucket with all branches and commits, you can follow the steps below:

  • Create a new repository on Bitbucket without README.md and .gitignore.

  • Clone the repository from GitHub to your local machine using the Git command:
git clone --mirror https://github.com/USERNAME/REPO-NAME.git

You'll notice that you have cloned something different from what a regular repository looks like. It will have folders like branches, hooks, objects, refs etc.

This is just because of the mirror tag you've added. Read More...

  • Next, change the remote URL to the new Bitbucket repository using the Git command:
$ cd repo-to-move.git
$ git remote set-url --push origin git@bitbucket.org:username/repo.git
  • Now, run the following command that will push all branches and commits to the Bitbucket repository:
$ git push --mirror

And, we're done moving the complete repository with branches, commits and tags.

Note: Make sure you have the necessary permissions to access and push to the Bitbucket repository. Also, be aware that any existing issues, pull requests, or other metadata will not be transferred to the Bitbucket repository.