Skip to content

Instantly share code, notes, and snippets.

@sommereder
Created May 8, 2021 07:26
Show Gist options
  • Save sommereder/ebf8d649f11e16e4a9601f76328a4338 to your computer and use it in GitHub Desktop.
Save sommereder/ebf8d649f11e16e4a9601f76328a4338 to your computer and use it in GitHub Desktop.
Move git repository from wherever to GitHub

Create a new repository on GitHub: https://github.com/new

Checkout the repository from the old provider using git clone --mirror, which implies -bare and thus does not generate a working copy:

git clone --mirror git@somewhere.com:company/myrepo.git

Change into project directory:

cd myrepo.git

Push to the new Git Server:

git push --mirror git@github.myorg/myrepo.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment