Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fwcd/glass

Tool for mirroring and backing up repositories from your online Git hosting accounts
https://github.com/fwcd/glass

git gitea github gitlab mirror

Last synced: 18 days ago
JSON representation

Tool for mirroring and backing up repositories from your online Git hosting accounts

Awesome Lists containing this project

README

        

# Glass

[![Typecheck](https://github.com/fwcd/glass/actions/workflows/typecheck.yml/badge.svg)](https://github.com/fwcd/glass/actions/workflows/typecheck.yml)

A tool that mirrors repositories from your online Git hosting accounts, including from GitHub, GitLab and Gitea.

## Usage

To use, create a `config.json` using any combination of the listed account types:

```json
{
"targetDir": "",
"accounts": [
{
"name": "your-github",
"type": "github",
"token": ""
},
{
"name": "your-gitlab",
"type": "gitlab",
"url": "",
"token": ""
},
{
"name": "your-gitea",
"type": "gitea",
"url": "",
"token": ""
},
{
"name": "a-single-repo",
"type": "git",
"url": ""
}
]
}
```

A JSON schema can be found [here](config.schema.json) for validation, autocompletion in your IDE etc.

The directory structure generated by `glass` will look similar to the following:

```
targetDir
├ your-github
│ ├ your-account
│ │ ├ repo1.git <- https://github.com/your-account/repo1.git
│ │ ├ repo2.git <- https://github.com/your-account/repo2.git
│ ...
├ your-gitlab
│ ├ your-account
│ │ ├ repo1.git <- https://your.gitlab/your-account/repo1.git
│ │ ├ repo2.git <- https://your.gitlab/your-account/repo2.git
├ your-gitea
│ ├ your-account
│ │ ├ repo1.git <- https://your.gitea/your-account/repo1.git
│ │ ├ repo2.git <- https://your.gitea/your-account/repo2.git
│ ...
├ a-single-repo
│ └ repo.git <- https://your.host/repo.git
...
```

Make sure that your token has permissions to read and clone the repositories you intend to mirror. Then launch the program with

```
python3 -m glass --config
```

Alternatively, you can place the config file in `~/.config/glass/config.json` and omit the argument:

```
python3 -m glass
```