Document helper script usage

This commit is contained in:
Midgard 2020-09-15 12:16:22 +02:00
parent 90b991f407
commit c25f99e1c8
Signed by: midgard
GPG Key ID: 511C112F1331BBB4
1 changed files with 13 additions and 1 deletions

View File

@ -28,7 +28,19 @@ cd
git clone https://git.zeus.gent/midgard/git-mirror.git; cd git-mirror
./git-mirror.sh ~/git-mirror-my-repo github gitea gitlab
```
The first remote, github is the leader. The others are followers that are updated.
The first remote, `github` in this case, is the leader. The others are followers that are updated.
If you want to do this conveniently every now and then, you can create a script like this in your
repository's directory:
```bash
#!/bin/bash
mirror="$HOME/git-mirror/git-mirror.sh"
here="$(dirname "$0")"
exec "$mirror" --notor "$here" github origin
```
Make sure to make it executable, and gitignore it when relevant. A good idea may be to choose an
arcane name, like `update--.sh`, and add it to a global gitignore file in `~/.gitignore`.
## Automate
To automate mirroring, run it periodically, for example once every 30 minutes. On a *NIX you could