Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fabianocouto/3419e38952f9e9a964d2548e880f1e8c to your computer and use it in GitHub Desktop.
Save fabianocouto/3419e38952f9e9a964d2548e880f1e8c to your computer and use it in GitHub Desktop.
How to transfer repository from any git service to Github

How to transfer/import repository from any git service to Github

In this example I'll use Bitbucket, but it works with any git service, like GitLab, OneDev, Gogs and others.

If the import tool does not work, perform the following steps.

Step 1

Create an empty repository on Github.

Example: https://github.com/fabianocouto/repo.git

Step 2

Clone repository hosted on another git service using --bare parameter

$ git clone --bare [email protected]:fabianocouto/repo.git

Step 3

Enter the cloned repo directory.

$ cd repo.git

Step 4

Push the cloned repository to Github with --mirror parameter

$ git push --mirror https://github.com/fabianocouto/repo.git

Step 5

Remove the temporary local repository.

$ cd ..
$ rm -rf REPO.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment