diff options
Diffstat (limited to 'gitolite-mirror.sh')
-rwxr-xr-x | gitolite-mirror.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gitolite-mirror.sh b/gitolite-mirror.sh new file mode 100755 index 0000000..8dfc857 --- /dev/null +++ b/gitolite-mirror.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +if [ $# -lt 1 ]; then + echo "missing gitolite config file" + exit 1 +fi + +RESET="\033[0m" +GREEN="\033[0;32m" + +GIT_URI=${GIT_URI:-"git://asynk.ch"} +GITOLITE_CONF=$1 + +cat $GITOLITE_CONF | grep '^repo' | sed 's/repo\s\+//' | while read repo; do + echo -e "** >$GREEN$repo$RESET<" + if [ -d "${repo}" ]; then + cd $repo + git remote update --prune + cd .. + else + git clone --mirror $GIT_URI/${repo}.git $repo + fi +done |