Giter Site home page Giter Site logo

github2gitea's Introduction

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"
}

github2gitea's People

Contributors

jmechnich avatar mahaesin avatar

Stargazers

Stefan Weil avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

mahaesin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.