summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-04-30 07:51:43 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-04-30 07:51:43 +0200
commit862635a269550fe74c6a007aa0d92b930b5ef260 (patch)
tree4da93ac9f0b5ddcbaaa27b943f96a6b6d82218b8
parent7fe0375a2a8f700cc3349ab5fd18a32e2f74bdc3 (diff)
downloadbin-862635a269550fe74c6a007aa0d92b930b5ef260.zip
bin-862635a269550fe74c6a007aa0d92b930b5ef260.tar.gz
add gitolite-mirror.sh
-rwxr-xr-xgitolite-mirror.sh23
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