From c25f99e1c80fb187371c8d85a61a193f6e8e5d2f Mon Sep 17 00:00:00 2001 From: Midgard Date: Tue, 15 Sep 2020 12:16:22 +0200 Subject: [PATCH] Document helper script usage --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5fa158..f5f59a2 100644 --- a/README.md +++ b/README.md @@ -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