GitMigration 2022

I want to migrate most my Git repos to Codeberg.

What does and doesn't get migrated

  • Migrate

    • Source repos, that is, authored by me and that I own

    • Forks, if they are independent of the upstream

  • Do not migrate

    • Projects I do not directly own

    • Projects that are private (that is, hidden from other users)

  • Delete

    • Forks I created to fix an issue and do not need any more

    • Projects that are abandoned and that I do not want to do any more

Checklist

  • Pick a repository

  • Find the latest version of the code. It may be

    • saved locally

    • stored in some Git repository

      • on GitHub

      • on GitLab.com

      • on the university's or institute's GitLab instance

      • on Codeberg

      • on Bitbucket (ew)

  • Clone the latest version of the code locally (~/Code)

  • Clean up repo

  • Create a repo on Codeberg, if not already

    • (alternatively) Import the existing GitHub repo to also migrate the metadata

  • Set the origin URL to Codeberg and push the repo

  • Set up mirroring

    • Create (if not already) the GitHub repo of the same name and path

      • That means, copy the organization name over as well, if possible

    • Turn off Wikis and Projects

    • Add "[MIRROR]" to the repo description and set COdeberg repo URL as project's URL

    • Create a GitHub token with the `public_repo` scope

    • Set up mirroring from Codeberg to GitHub by using the token as password

    • Make sure it can push

  • (if project is finished) Back up the project to the Archivum

See also