A central place of information about mirroring repos to Codeberg #GiveUpGitHub
Find a file
HexagonCDN 26c18a0758 Are releases also mirrored? - #16
Thank you @inson1
I may add examples in the future.
2024-02-26 14:41:44 +00:00
.codeberg Update codebergmigration.webp 2023-12-25 07:24:18 +00:00
.gitea/ISSUE_TEMPLATE Add https://www.markdownguide.org/ 2023-01-14 03:32:54 +00:00
LICENSE Initial commit 2022-12-30 01:57:45 +00:00
README.md Are releases also mirrored? - #16 2024-02-26 14:41:44 +00:00

Table of contents

  1. Why should we mirror to Codeberg™?
  2. Resources
  3. FAQ
  4. GitHub - Codeberg mirroring tutorial
  5. GitLab - Codeberg mirroring tutorial
  6. Special thanks
  7. License
  8. Legal notice

1. Why should we mirror to Codeberg™?

  1. Codeberg is libre, free, open-source, privacy-friendly, non-profit, really fast
  2. GitHub™ is privacy-invasive, Microsoft-owned, proprietary, vendor-lock-in, Tor-hostile
  3. GitHub Copilot™ attacks copyleft licensing
  4. GitLab™ uses Google's horrible-to-navigate user interface (just Cadence's & @HexagonCDN 's personal opinions) & GitLab is too slow (for many people & @HexagonCDN), not fully open-source, for-profit, Tor-hostile, hosted on Google Cloud™, proxied through Cloudflare™ and even more vendor-lock-in than GitHub (Example: You must sign in to search for issues on GitLab!)
  5. People on Codeberg can contribute to the project
  6. GitHub & GitLab can take down our repos
  7. You can clone a Git repository with an IPv6 address from Codeberg, which still doesn't work with GitHub at the moment

2. Resources

  1. https://sfconservancy.org/GiveUpGitHub
  2. https://github.com/humanetech-community/awesome-humane-tech/issues/33
  3. https://github.com/ungoogled-software/ungoogled-chromium/discussions/1894
  4. https://cadence.moe/blog/2022-07-03-git-forge-opinions-github-gitlab-gitea-sourcehut
  5. https://github.com/andersju/webbkoll/issues/35
  6. https://docs.codeberg.org/advanced/migrating-repos

3. FAQ

  1. Q: GitHub Actions is a huge time saver for me. Forcing all contributors to modify their current setup and move to another hosting may just cause losing contributors in the end.

    A: As I said, we only just mirror. The repo will be available and contributable on both sites.

  2. Q: I can make a read-only mirror.

    A: As I said, we should have a mirror that's contributable.

  3. Q: Is transferring issues possible? Issues here represent a technical knowledge base we can't live without. Is transferring wiki and all edit history possible? Is transfering releases possible?

    A: Yes, it's possible.

a. Example for issues:

GitHub Codeberg
https://github.com/andersju/webbkoll/issues/35 dataskydd.net/webbkoll#35
https://github.com/andersju/webbkoll/issues/33 dataskydd.net/webbkoll#33
https://github.com/zyachel/quetre/issues/7 zyachel/quetre#7

b. Example for commits:

c. Example for wiki:

d. Example for releases:

  1. You can transfer releases, but I think it isn't possible to mirror releases. Only tags are mirrored. So you would have to manually make releases on GitHub and Codeberg.

  2. Q: Despite having mirror(s), the project will still continue to be operated from GitHub for development, so having yet another mirror doesn't solve anything.

    A: You can create issues, contribute, view the repos on there without going to GitHub! Example:

GitHub Codeberg
https://github.com/libredirect/libredirect https://codeberg.org/LibRedirect/libredirect
https://github.com/zyachel/quetre https://codeberg.org/zyachel/quetre
https://github.com/nesaku/BiblioReads https://codeberg.org/nesaku/BiblioReads
  1. Q: Does Codeberg has a Discussion tab like GitHub?

    A: Currently, Codeberg doesn't have a separate Discussion tab. There are some requests about that:

a. Codeberg/Community#528 b. Codeberg/Community#1331

  1. Q: Is Codeberg well funded?

    A: https://docs.codeberg.org/getting-started/faq/#is-codeberg-well-funded%3F

Codeberg is primarily funded by donations. As of July 2020, with all expenses frozen, we have a runway of ~12 years, so you don't have to worry that our service will suddenly disappear.

  1. Q: My repos are very bandwidth-intensive projects, and I have my doubts as to whether the owner(s) of Codeberg would be prepared for such a massive bandwidth rate increase. I've also had individual projects be disabled on small sites before due to taking too much bandwidth.

    A: @HexagonCDN isn't sure. @HexagonCDN thinks you should directly ask https://docs.codeberg.org/contact about if they are ready for massive bandwidth rate.

  2. Q: Is Codeberg hosted with renewable or non-polluting energy sources?

    A: I opened an issue asking Codeberg about this: Codeberg/Community#856

4. GitHub - Codeberg mirroring tutorial

There are multiple ways to accomplish this, including ways other than the ones listed below.

Step 1 - Initial Repository Migration From GitHub:

This is done through the Codeberg website.

Generate a Personal Access Token and use the new migration Codeberg option to create a mirror of the GitHub repository.

Screenshot of Codeberg's 'Migrate From GitHub' interface

Commits, issues, pull requests, labels & more will be migrated with this option.

Note: Treat your access token like a password. It is recommended to set up a limited scope for your access token.

Step 2 - Mirror GitHub Commits To Codeberg:

Makes it possible so that commits made are pushed to GitHub & Codeberg.

Option 1 - Using the git command line

git remote set-url --add --push origin https://codeberg.org/user/repo.git

Note: Replace https://codeberg.org/user/repo.git with your Codeberg repository URL from Step 1. This only affects pushing from the local repository.

Option 2 - Using GitHub Actions

Using mirror-repository by yesolutions

Use GitHub Actions to push GitHub commits to Codeberg. mirror-repository by yesolutions

  1. Create a new secret for GitHub Actions. Here is GitHub's guide to Repository Secrets: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions.
  2. Add GitHub Actions to your project. Example GitHub Actions file can be found here
Using mirroring-repository by pixta-dev

Another similar way is to use mirroring-repository by pixta-dev. Example GitHub Actions file can be found here. However, it didn't work so well for @Tuxilio (#11).

Note: This requires you to generate and add SSH keys to both Codeberg & GitHub.

Step 3 - Mirror Codeberg Commits To GitHub:

Makes it possible so that commits made on Codeberg are pushed to GitHub.

Use the "Mirror Settings" option (can be found in your Codeberg repository setting) to set up a push mirror from Codeberg to GitHub.

  • Under Git Remote Repository URL, input your GitHub repository URL
  • In the Authorization dropdown, enter your GitHub username in the Username input and use your access token (you can use the same token you generated in Step 1) in the Password input
  • Click the Sync when commits are pushed checkbox
  • Set your desired Mirror Interval
Screenshot of Codeberg's 'Mirror Settings' option

5. GitLab - Codeberg mirroring tutorial

Step 1 - Initial Repository Migration From GitLab:

In Codeberg, create a new migration to create a mirror of your GitLab repository.

Commits, issues, pull requests, labels & more will be migrated with this option.

Step 2 - Mirror GitLab Commits To Codeberg:

Makes it possible so that commits made are pushed to GitLab & Codeberg.

Option 1 - Using the git command line

git remote set-url --add --push origin https://codeberg.org/user/repo.git

Note: Replace https://codeberg.org/user/repo.git with your Codeberg repository URL from Step 1.

Option 2 - Using GitLab repository mirroring

In your GitLab repository, head to Settings -> Repository -> Mirroring repositories.

  • Git repository URL: ssh://codeberg.org/user/repo.git
  • Mirror direction: Push
  • Authentication method: SSH public key
  • Keep divergent refs: Recommend to enable especially if you're going to have Codeberg Pages
  • Mirror only protected branches: Enable if you just want to mirror the main and/or any other branches marked as protected
Screenshot of GitLab's 'Mirroring repositories' option

Click on the copy button to copy the SSH public key.

Screenshot of GitLab's SSH public key

Back in your migrated Codeberg repository, head to Settings -> Deploy Keys -> Add Deploy Key. Paste the SSH public key and tick Enable Write Access.

Screenshot of Codeberg's deploy key

6. Special thanks

If you aren't on the above list, don't feel bad about it. We still give our regular thanks to you.

7. License

This text is dedicated to public domain and is therefore licensed under the CC0 1.0 License.

This repository is not affiliated with any of the mentioned companies and Codeberg e.V. Trademarks belong to their respective owners.

Codeberg is a registered trademark of Codeberg e.V. GitHub and GitHub Copilot are registered trademarks of GitHub, Inc. GitLab is a registered trademark of GitLab Inc. Google Cloud is a registered trademark of Google LLC. Cloudflare is a registered trademark of Cloudflare, Inc.