Migrating your code
The easiest thing to do when moving to GitHub is migrating your code, especially when the code is already stored in another Git repository. Just clone the repository using --bare
to make sure the repository is in a clean state:
$ git clone --bare <URL to old system>
Then push the code to the repository:
$ git push --mirror <URL to new repository>
If the repository already contains code, you must add the --force
parameter to override. You can also use the GitHub CLI to create a repository on the fly when pushing an existing one:
$ gh repo create <NAME> --private --source <local path>
Since in Git the author information is matched using an email address, you just have to create user accounts in GitHub for all users and assign them the email address used in your previous Git system. The authors will then be resolved correctly.
You can also import code using the GitHub Importer. Besides Git, the following repository types...