Giter Site home page Giter Site logo

gogs-migrate's Introduction

gogs-migrate npm version

Migrate existing repositories on a Gogs instance.

Overview

Gogs is a lightweight self-hosted Git service. There's a neat GitHub-like interface to show, the repositories, and I find it perfect to mirror public GitHub repositories on a home server, and have really private repositories (that don't even leave your home, unlike "private" cloudish solutions). It's also really lightweight, unlike GitLab, and can easily run with SQLite on tiny computers like a Raspberry PI!

There is a built-in way to migrate external repositories, with a mirror option so your local copy is always up-to-date. And the interesting thing is there's an API to automate this task.

gogs-migrate is a script to automatically migrate (and optionally mirror) all your repositories from different sources (currently only GitHub public repositories are supported), to your Gogs instance.

You need to configure your Gogs URL (--gogs), access token and UID (--gogs-token, and --gogs-uid). If those options are not passed via CLI, and a configuration file is given (--config), gogs-migrate will try to read them from the configuration file. Otherwise, it will prompt for the missing options.

Then, you can configure a source for the repositories to migrate. Currently, only GitHub is supported, with the --github-user option. It will find only the public repositories, and there's currently no way to configure credentials to access private repositories. You can migrate your forks with the --with-forks option, but by default gogs-migrate will ignore them.

On Gogs side, you can pass --mirror so the migrated repositories are flagged as mirrors (Gogs will update them periodically), and --private to make them private.

Installation

With npm

npm install -g gogs-migrate

Manually

Clone this repository, then in the directory:

npm install

You can now use bin/gogs-migrate (or put $PWD/bin in your PATH).

Usage

gogs-migrate [options]

Options

Name Description
-h, --help Show help.
-V, --version Show version.
-c, --config=<path> Read options from given YAML configuration file.
--gogs-prefix=<prefix> Gogs URL prefix (like https://git.example.com).
--gogs-token=<token> Gogs access token (required, prompt otherwise).
--gogs-uid=<uid> Gogs UID (required, prompt otherwise).
--github-prefix=<prefix> GitHub API prefix (defaults to https://api.github.com).
--github-user=<user> GitHub username to stream repositories from.
--github-token=<token> GitHub user token to access private repositories.
--mirror Create mirror repositories.
--private Force private repositories (copy source visibility otherwise).
--with-forks Include forked repositories.
--save Save migrated repositories to configuration file to avoid downloading them again the next time.

Configuration

You can specify a YAML configuration file with the --config option. It can contain all the normal CLI long options, with the leading -- removed.

gogs: https://git.example.com
gogs-token: foo
gogs-uid: 42
github-user: bar
mirror: true

Here, gogs-pass is not specified, and if it's not given via CLI, so you will be prompted for your password (that's the recommended way).

gogs-migrate's People

Contributors

valeriangalliat avatar

Watchers

jens alexander ewald avatar James Cloos avatar

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.