GitHub - richardARPANET/gitea-to-github: Tool to migrate repos and orgs from Gitea to Github

1 min read Original article β†—

Repository files navigation

gitea-to-github

Migrate organizations and repositories from Gitea to GitHub with ease.

Features

  • πŸ”„ Migrate entire organizations with all repositories
  • πŸ—ΊοΈ Interactive org-to-org/user mapping
  • πŸ’Ύ Saves configuration for repeated runs
  • πŸ”’ Preserves repository visibility (public/private)
  • πŸ“¦ Maintains full git history, branches, and tags
  • πŸ§ͺ Dry-run mode for safe testing

Requirements

  • gh - GitHub CLI (authenticated)
  • git, curl, jq
  • Gitea personal access token with read permissions

Usage

# Make executable
chmod +x migrate-gitea-to-github.sh

# Run migration (interactive setup on first run)
./migrate-gitea-to-github.sh

# Dry-run mode (preview without making changes)
./migrate-gitea-to-github.sh --dry-run

# Force real migration (skip safety prompt)
./migrate-gitea-to-github.sh --no-dry-run

Configuration

After first run, settings are saved to ./gitea-migration-config.yml:

gitea:
  url: "https://your-gitea-instance.com"
  token: "your-token-here"

mappings:
  - gitea: "source-org"
    github: "target-org-or-username"

How it works

  1. First run: Enter Gitea URL and token, map each org to GitHub target
  2. Subsequent runs: Uses saved config, just press Enter to proceed
  3. Migration: Clones each repo with --mirror and pushes to GitHub

Safety

  • Defaults to dry-run mode
  • Shows preview before migrating
  • Skips existing repositories (with option to overwrite)