/simple-git-mirror-sync

Very simple script for syncing source to target git repo

Primary LanguageShellMIT LicenseMIT

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 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):

  • ./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
  • lgg, 2020