Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 825
danilodeveloper Avatar asked Jan 21 '14 14:01

danilodeveloper


People also ask

How do I change a private repository to public in Bitbucket?

Making a repository publicly accessibleGo to the repository and click Settings, then Repository (under 'Permissions'). Check Enable (under 'Public Access') to allow users without a Bitbucket account to clone and browse the repository.

Can I change private repo to public GitHub?

Changing a repository's visibilityOn GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Danger Zone", to the right of to "Change repository visibility", click Change visibility. Select a visibility.

How do I import a private repository to GitHub?

In the upper-right corner of any page, click , and then click Import repository. Under "Your old repository's clone URL", type the URL of the project you want to import. Choose your personal account or an organization to own the repository, then type a name for the repository on GitHub.


1 Answers

  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
like image 54
danilodeveloper Avatar answered Sep 18 '22 00:09

danilodeveloper