Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fwcd/glass
- Owner: fwcd
- License: mit
- Created: 2021-01-20T01:50:30.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T00:27:16.000Z (about 1 year ago)
- Last Synced: 2024-10-15T13:05:53.851Z (30 days ago)
- Topics: git, gitea, github, gitlab, mirror
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```