4 # manage a set of simpler (than git-miror.sh does), pull-only repos
5 # the idea here is, we need to keep a local read-only mirror
8 # e.g. /git-slave/tophat.git on onelab.eu which is a mirror of
9 # git.top-hat.info/tophat.git that can't easily be exposed as a git feed
11 # instead of hacking git-mirror.sh script that is already scary,
12 # I preferred to keep this separate
14 # so the overall layout is as follows
15 # * manually created the local mirror by running
17 # git clone --mirror ssh://tophat@git.top-hat.info/tophat.git
18 # which creates a *bare* repo /git-slave/tophat.git
19 # * create a symlink for git-daemon and for gitweb
21 # ln -s /git-slave/tophat.git
22 # Being a symlink this won't be considered by the main purpose of git-mirror.sh
24 # Typical usage in cron
25 # */3 * * * * /root/bin/git-slave.sh -q /git-slave/*.git
27 # you might wish to tweak the repo's config, in particular the remote section
28 # so as to define the proper mappings for your needs
29 # e.g. from git.onelab.eu:/git-slave/rvm-rpm.git
31 # url = https://github.com/cdwertmann/rvm-rpm.git
32 # fetch = refs/heads/*:refs/heads/*
33 function slave_repo () {
36 git fetch --all --tags -q
39 for slave_dir in "$@"; do slave_repo $slave_dir; done