Skip to content

bitounu/gitea-move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitea-move

CLI script to interactively migrate repositories between organizations on the same Gitea instance via the Transfer Ownership API.

Prerequisites

  • Python 3.10+
  • uv — fast Python package manager

Installation

# Clone the repo
git clone <repo-url>
cd gitea-move

# Install dependencies
uv sync

Configuration

Copy the example config and fill in your values:

cp .env.example .env

Edit .env:

GITEA_URL=https://gitea.example.com
GITEA_TOKEN=your_api_token_here

Token permissions required:

  • user: read — required by the organizations list endpoint
  • organization: read — to list organizations
  • repository: write/admin — to transfer repositories

Generate a token at: https://<your-gitea>/user/settings/applications

Usage

uv run migrate.py

The script will:

  1. Ask you to select the source organization
  2. Show a checkbox list of repos — select which ones to migrate (space to select, enter to confirm)
  3. Ask you to select the target organization
  4. Show a confirmation summary and ask to proceed
  5. Execute transfers and print a final summary

Example output:

? Select source organization: my-old-org
? Select repositories to transfer: done (3 selections)
? Select target organization: my-new-org

About to transfer 3 repo(s): my-old-org → my-new-org
  - repo-alpha
  - repo-beta
  - repo-delta

? Proceed with transfer? No

Summary:
  ✓ repo-alpha                   → my-new-org
  ✓ repo-beta                    → my-new-org
  ✗ repo-delta                   FAILED: 422 Repository name already exists

Results: 2 succeeded, 1 failed

Running tests

uv run --group dev pytest tests/ -v

About

TUI application to move multiple Gitea repos between organizations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages