A central place of information about mirroring repos to Codeberg #GiveUpGitHub
 
Go to file
HexagonCDN 07a4f8c694 Merge pull request 'feat: possible to Git clone with IPv6' (#10) from privacy1st/Mirror_to_Codeberg:main into main
Reviewed-on: #10
2023-07-01 02:43:59 +00:00
.codeberg Replace light mode PNG with dark mode WEBP 2023-03-26 15:23:40 +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 feat: possible to Git clone with IPv6 2023-06-30 09:03:05 +00:00

README.md

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

Why should we mirror to Codeberg™?

  1. Codeberg is libre, free, open-source, privacy-friendly, non-profit, really fast
  2. GitHub™ has bloated interface & 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 (for Cadence & me) & GitLab is too slow (for many people & me), 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 like me 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

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

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?

    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:

  1. 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: 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: Oh.. I think 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

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.

Option 2 - Using GitHub Actions

Use GitHub Actions to push GitHub commits to Codeberg. Example GitHub Actions file can be found here.

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

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

Special thanks

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

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.