Skip to main content

Migrates GitHub repositories to Gitea.

Project description

PyPI versio PyPi format PyPI license PyPi weekly downloads

github2gitea

Migrates GitHub repositories to Gitea.

github2gitea is a command-line application for importing and mirroring GitHub repositories to Gitea. It can be used as well for continously adding newly created repositories in regular intervals, e.g. using cron.

Usage

All usage parameter can be set as command-line arguments:

usage: github2gitea [-h] [-c CONFIG_FILE] [-d] [-n] [-p] [-q] [-s]
                    [--github-token GITHUB_TOKEN] [--github-user GITHUB_USER]
                    [--gitea-apiurl GITEA_APIURL] [--gitea-token GITEA_TOKEN] [--exclude]
                    [--migrate-forks] [--owner-filter OWNER_FILTER] [--migrate-issues]
                    [--migrate-labels] [--migrate-milestones] [--migrate-pull-requests]
                    [--migrate-releases] [--migrate-wikis] [--mirror]
                    [--mirror-interval MIRROR_INTERVAL] [--owner OWNER] [--recreate]
                    [--use-full-name]
                    [repos ...]

Migrate GitHub repositories to Gitea.

positional arguments:
  repos                 (optional) explicit list of GitHub repositories formatted as
                        owner/name. By default, only the listed repositories are processed.
                        If the --exclude option is given, the listed strings are used as
                        search patterns for removing repositories.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        path to config file
  -d, --debug           enable debug output
  -n, --dry-run         execute read-only actions
  -p, --print-config    print configuration and exit
  -q, --quiet           enable quiet mode
  -s, --syslog          enable logging to syslog
  --github-token GITHUB_TOKEN
                        set GitHub access token
  --github-user GITHUB_USER
                        set GitHub user
  --gitea-apiurl GITEA_APIURL
                        set Gitea API URL
  --gitea-token GITEA_TOKEN
                        set Gitea access token
  --exclude             exclude repositories instead of exclusively selecting them
  --migrate-forks       migrate forks
  --owner-filter OWNER_FILTER
                        set GitHub repository owner filter
  --migrate-issues      migrate issues
  --migrate-labels      migrate labels
  --migrate-milestones  migrate milestones
  --migrate-pull-requests
                        migrate pull requests (not yet fully implemented in Gitea)
  --migrate-releases    migrate releases (not yet fully implemented in Gitea)
  --migrate-wikis       migrate wikis
  --mirror              set up mirroring of repo
  --mirror-interval MIRROR_INTERVAL
                        mirror interval (default: 8 hours). Valid time units are "h", "m,
                        "s". 0 to disable automatic sync
  --owner OWNER         set Gitea user or org owning the repos (default: owner of used access
                        token)
  --recreate            recreate repos if they already exist
  --use-full-name       use full repo name including owner for migration (i.e. "owner_name")

Alternatively, configuration parameters can be set in a json-formatted file.

Default search paths are:

  • $HOME/.config/github2gitea/config.json
  • $PWD/config.json

An additional file path can be added using the -c/--config-file option.

Minimal settings required for running

First, create a Personal Access Token on GitHub with at least scope repo. Consider setting an unlimited lifetime.

Create a Gitea access token for your user.

Set the following in a configuration file (or the corresponding command-line options):

{
  "github_user"  : "GITHUB_USERNAME",
  "github_token" : "GITHUB_PERSONAL_ACCESS_TOKEN",
  "gitea_apiurl" : "GITEA_APIURL",
  "gitea_token"  : "GITEA_ACCESS_TOKEN"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github2gitea-0.6.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

github2gitea-0.6.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file github2gitea-0.6.1.tar.gz.

File metadata

  • Download URL: github2gitea-0.6.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for github2gitea-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b33aff76d638ccbea73bd8ba82a8264c566d1e28d465f03dce77ba0413eb1c36
MD5 411e2ccd30a8911f7458f11436df50df
BLAKE2b-256 fa00202967f6bcb51d1769688c7d5f186f0038479edc4c5fa6912ad97b66e7cd

See more details on using hashes here.

File details

Details for the file github2gitea-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github2gitea-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 935d27d92f8a7e3de43ec147122161ad647a756be1df3e655be52ff48951d60a
MD5 713aaf9262c73c5a1dd8609cd52182e2
BLAKE2b-256 0ccfc334bad4016cb5b6e56633861bf5ac04cf3e76a4f8edaa0675c60d88bf17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page