danilodeveloper
danilodeveloper

Reputation: 3880

How to migrate a private Bitbucket repository to a public Github repository

How can I migrate a private Bitbucket repository to a public Github repository?

Upvotes: 5

Views: 2704

Answers (1)

danilodeveloper
danilodeveloper

Reputation: 3880

  1. Make a "bare" clone of the repository (i.e. a full copy of the data, but without a working directory for editing files) using the external clone URL. This ensures a clean, fresh export of all the old data.
  2. Push the local cloned repository to GitHub using the "mirror" option, which ensures that all references (i.e. branches, tags, etc.) are copied to the imported repository.

Here are all the commands:

git clone --bare https://bitbucket.com/user/repo.git
cd repo.git
git push --mirror https://github.com/ghuser/repo.git

Upvotes: 8

Related Questions