No description
Find a file
Jannis Feldmann 12f6e5afaa add
2025-08-21 16:49:46 +02:00
.claude add 2025-08-21 16:49:46 +02:00
node_modules add 2025-08-21 16:49:46 +02:00
bun.lock add 2025-08-21 16:49:46 +02:00
index.js add 2025-08-21 16:49:46 +02:00
MIGRATION_WORKFLOW.md add 2025-08-21 16:49:46 +02:00
package.json add 2025-08-21 16:49:46 +02:00
README.md first commit 2025-08-21 16:49:17 +02:00
removeAllRepos.js add 2025-08-21 16:49:46 +02:00

MigrateForge

A command-line tool for migrating repositories from GitHub to Forgejo/Gitea instances with full organization support.

Features

  • 🔐 Secure Authentication: GitHub Personal Access Tokens
  • 🏢 Organization Support: Migrate entire organizations with name conflict resolution
  • 📦 Comprehensive Migration: Issues, PRs, releases, wikis, labels, milestones, and LFS
  • 🔄 Mirror Support: Keep repositories synchronized with GitHub
  • 🎯 Selective Migration: Choose specific repositories to migrate
  • 🏷️ Custom Naming: Flexible repository naming with JavaScript expressions
  • Rate Limiting: Intelligent retry logic with progress display
  • 🎨 Beautiful UI: Colorful terminal interface with real-time progress

Installation

npm install

Usage

Run the migration tool:

npm start

The tool will guide you through:

  1. GitHub Authentication - Personal Access Token setup
  2. Forgejo/Gitea Setup - Server URL and API token creation
  3. Migration Options - Select what data to migrate
  4. Organization Transfer - Choose to migrate organizations or select individual repos
  5. Repository Naming - Configure how repos will be named
  6. Migration Execution - Real-time progress with retry logic

GitHub Authentication

Create a Personal Access Token at https://github.com/settings/tokens/new with these scopes:

  • repo - Full control of private repositories
  • read:org - Read org and team membership
  • read:user - Read user profile data

Forgejo/Gitea Setup

Create an API token with these permissions:

  • write:repository - Create and manage repositories
  • write:organization - Create and manage organizations
  • write:user - Manage user account

Migration Options

  • Mirror Repositories - Keep repos synchronized with GitHub
  • LFS Files - Migrate Git Large File Storage data
  • Wiki - Migrate repository wikis
  • Issues - Migrate GitHub issues
  • Pull Requests - Migrate PRs (where supported)
  • Labels - Migrate issue/PR labels
  • Milestones - Migrate project milestones
  • Releases - Migrate GitHub releases

Repository Naming

Customize how repositories are named using these variables:

  • {orgName} - Original organization/user name
  • {repoName} - Original repository name

Examples:

  • {orgName}-{repoName} - Default format
  • {repoName} - Keep original names
  • gh-{orgName}-{repoName} - Add prefix
  • {orgName.toLowerCase()}-{repoName} - JavaScript expressions
  • {orgName.replace("old", "new")}-{repoName} - String replacement

Error Handling

  • Rate Limiting: Automatic retry with exponential backoff
  • Network Errors: Up to 5 retry attempts per repository
  • Validation: Duplicate name detection and conflict resolution
  • Progress Tracking: Real-time status updates with color coding

Requirements

  • Node.js 18+
  • Access to GitHub API
  • Forgejo/Gitea instance with API access
  • GitHub Personal Access Token with required scopes

License

MIT