Skill v1.0.0
currentAutomated scan100/100version: "1.0.0" name: git-forge-migration description: > Migrate repos between git forges (GitHub/Gitea/Codeberg). tags:
- git
- github
- gitea
- codeberg
- migration
metadata: author: hermes version: "1.0"
Git Forge Migration
Use when the user wants to move or mirror repositories between hosting platforms (GitHub, Gitea, Forgejo, Codeberg, GitLab), or when deciding where to host repos.
Context
the user runs a self-hosted Gitea at eminent-kagu.pikapod.net (Pikapods, v1.27.2), already used for Obsidian vault sync. Public repos live on GitHub. Codeberg is a Forgejo (Gitea fork) nonprofit host. As of 2026-08 he is evaluating leaving GitHub after recurring outages. The current plan and repo lists live in Obsidian: Projects/Git Forge Migration - Plan.md — read it before executing anything.
Assessment workflow (validated 2026-08)
- Inventory and classify repos (forks vs originals, private vs public):
gh repo list --limit 200 --json name,isPrivate,isFork,parent,pushedAt
- Count GitHub Actions workflows per repo to gauge CI migration cost:
gh repo list --limit 200 --json name | python3 -c "import json,sys; print('\n'.join(r['name'] for r in json.load(sys.stdin)))" | xargs -P 8 -I{} sh -c 'n=$(gh api repos/OWNER/{}/contents/.github/workflows --jq "length" 2>/dev/null || echo 0); [ "$n" != "0" ] && echo "{}: $n"'
- Check target forges are reachable and current:
curl -s https://<gitea>/api/v1/version and curl -s -o /dev/null -w '%{http_code}' https://codeberg.org/api/v1/version
Decision framework
- Neither target beats GitHub on raw uptime. A self-hosted Gitea on one
Pikapod is a single point of failure plus admin burden; Codeberg is small nonprofit infra with a history of capacity/abuse incidents. Availability comes from redundancy (multi-remote), not from moving to a smaller host.
- Recommended shape: Gitea primary (matches the user's self-hosting pattern,
natural home for private repos, Actions-compatible CI via act_runner, ActivityPub federation), Codeberg as public mirror (FOSS visibility on a nonprofit host), GitHub kept as a mirror (discoverability; forks live there anyway).
- CI porting cost: Gitea Actions is syntax-compatible with GitHub Actions;
Codeberg's Woodpecker is not. If repos use Actions workflows, Gitea is the cheaper target.
- Forks never migrate. They exist because upstream lives on GitHub; PR
contribution workflows stay there. Only originals are candidates.
- GitHub Pages sites (e.g.
jcrabapple.github.io) stay on GitHub.
Mirror-first strategy (proposed, not yet executed)
The assessment above is validated; the execution phases below were designed but not yet run. Verify against current Gitea/Codeberg docs when executing.
- Create migration repos on targets. Set up Gitea push mirrors
(Settings > Push Mirror) so every push to Gitea lands on GitHub and Codeberg automatically. Add all three remotes locally; keep origin on GitHub until the flip is decided. Run mirrors for weeks before committing.
- Flip primary: point
originat Gitea, migrate issues/PRs per repo via
Gitea's "New Migration" (one-time), set up Renovate for dep updates.
- Harden Gitea before it becomes primary home of many repos: custom domain
(not the pikapod.net slug), offsite backups (mirrors are the second copy), act_runner if CI is wanted, confirm open registration is disabled.
Pitfalls
gh repo list --json parentreturns parent objects whose exact fields vary
(nameWithOwner can be absent) — read defensively with .get(), don't index fields blindly.
- The workflow-count loop mixes gh API 404 noise into stdout for repos without
workflows; the real signal is the name: N lines. Filter stderr or accept the noise.
- Private repos: Codeberg allows them but prefers FOSS use; self-hosted Gitea
is the natural home for private work.
- Long repo lists sort the same as everything else: keep the fork/original
split explicit in any saved plan so future sessions don't re-derive it.