https://github.com/lgg/simple-git-mirror-sync
Very simple script for syncing source to target git repo
https://github.com/lgg/simple-git-mirror-sync
git git-mirror git-sync github gitlab gitlab-sync mirror sync sync-git sync-repo synchronization
Last synced: about 1 year ago
JSON representation
Very simple script for syncing source to target git repo
- Host: GitHub
- URL: https://github.com/lgg/simple-git-mirror-sync
- Owner: lgg
- License: mit
- Created: 2020-06-14T21:38:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T23:44:40.000Z (over 5 years ago)
- Last Synced: 2025-01-28T00:41:30.426Z (about 1 year ago)
- Topics: git, git-mirror, git-sync, github, gitlab, gitlab-sync, mirror, sync, sync-git, sync-repo, synchronization
- Language: Shell
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple git sync
This script simply sync git repo from `source` to `target`
**It works only with ssh@git**
**https:// not supported now**
## SSH keys
It uses` id_ed25519` SSH keys from [.ssh](./.ssh) folder to run on server with crontab
## Usage
Script works only with `git@ssh` url, `https://` doesn't work
Install requirements and add SSH keys:
* `./install.sh`
Manually run:
* `./sync.sh git@source git@target`
Run with config (don't forget to edit `config.conf` for your needs, [check example](./config-sample.conf)):
* `./sync.sh -c`
Config example:
```
sourceRepo1 targetRepo1
sourceRepo1 targetRepo2
sourceRepo3 targetRepo3
```
You set source git repo _space_ target git repo
### Run with crontab
* `crontab -e`
* `* */6 * * * /bin/bash /var/git/simple-git-mirror-sync/sync.sh -c >/dev/null 2>&1`
* `/bin/bash` - path to `bash` on your server, you can check it with `which bash` on your server
* `/var/git/simple-git-mirror-sync/sync.sh` - full path to this script
## License
* Contributing are welcome!
* [MIT](./LICENSE)
* [lgg](https://github.com/lgg), 2020