https://github.com/zcyc/repo-sync
This is a repositories synchronize tool alternative to gitlab mirroring repositories.
https://github.com/zcyc/repo-sync
Last synced: 12 days ago
JSON representation
This is a repositories synchronize tool alternative to gitlab mirroring repositories.
- Host: GitHub
- URL: https://github.com/zcyc/repo-sync
- Owner: zcyc
- License: agpl-3.0
- Created: 2022-08-12T13:42:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-02T02:02:29.000Z (10 months ago)
- Last Synced: 2025-07-02T03:19:16.096Z (10 months ago)
- Language: Rust
- Homepage: https://github.com/zcyc/repo-sync
- Size: 71.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# repo-sync
A lightweight synchronization tool for git repositories.
## Manual
```
USAGE:
repo-sync [OPTIONS]
OPTIONS:
-c, --crontab crontab string, eg: '0 * * * * ? *'
-f, --file config file path, eg: ./config.json
-h, --help Print help information
-s, --source source repo, eg: https://github.com/zcyc/repo-sync.git
-t, --target ... target repo, eg: https://github.com/zcyc/repo-sync.git
-b, --branch specific branch to sync, eg: 'main'
-V, --version Print version information
```
## Notice
Before you begin the task, make sure that you can access and operate your source and target repositories.
## Configuration
You can configure repo-sync using a JSON file. Here's an example:
```json
[
{
"source": "https://github.com/zcyc/repo-sync.git",
"target": [
"https://github.com/zcyc/repo-sync-1.git",
"https://github.com/zcyc/repo-sync-2.git"
],
"crontab": "0/10 * * * * ? *",
"branch": "main"
},
{
"source": "https://github.com/zcyc/repo-sync.git",
"target": [
"https://github.com/zcyc/repo-sync-3.git"
],
"crontab": "0/10 * * * * ? *"
}
]
```
- `source`: The source repository URL
- `target`: An array of target repository URLs
- `crontab`: The schedule for synchronization
- `branch`: (Optional) Specific branch to sync. If provided, the tool will:
- Clone the repository with the specified branch (`git clone -b `)
- Pull from the specified branch (`git pull origin `)
- Push only the specified branch to target repositories (`git push target `)
- If not provided, all branches will be synced (`git push --all`)
## Why Not
- [git-sync](https://github.com/kubernetes/git-sync) of `kubernetes` only synchronizes the repository into the folder.
- [Repository mirroring](https://docs.gitlab.com/ee/user/project/repository/mirror/) of `GitLab` requires a paid version.