1
1
Fork
You've already forked github-to-codeberg
0
No description
  • Shell 100%
2025年12月29日 21:03:25 -04:00
copy.sh copy: Only specify "repo_owner" for Org repos. 2025年03月28日 21:32:46 -04:00
README.md readme: Add org creation step for copy script. 2025年03月28日 21:33:46 -04:00
redirect.sh Update permissions on redirect.sh 2025年12月29日 21:03:25 -04:00
template.md First commit. 2025年03月25日 20:45:50 -04:00

Some scripts I quickly wrote to copy my GitHub repositories over to Codeberg.

Copy

This script:

  1. Iterates through repositories (defaults to "user" repos only unless specified otherwise).
  2. If the target repository is from a GitHub organization, create the same organization on Codeberg if it doesn't exist.
  3. Migrates the code and issues from GitHub to a public repo on Codeberg.

Requirements:

  • github-cli - Because I couldn't be bothered handling API pagination.
  • GH_TOKEN - Environment variable holding your GitHub Personal Access Token
  • CB_TOKEN - Environment variable holding your Codeberg Personal Access Token
Usage: ./copy.sh [-t <all|org|user>]
options:
-t the type of repositories to process. Defaults to 'user'.

Redirect

This script:

  1. Iterates through a user’s repositories.
  2. Deletes the repository (to get rid of history, issues, etc).
  3. Creates and clones a repository of the same name.
  4. Adds a README.md pointing to the new location.
  5. Pushes the file over to GitHub over SSH.

Requirements:

  • github-cli - Because I had it installed for the previous script
  • GH_TOKEN - Environment variable holding your GitHub Personal Access Token
  • Replace cb-username with your Codeberg username
  • Replace gh-username with your GitHub username