]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
git mirror update script
authorRudolf Polzer <divverent@alientrap.org>
Tue, 21 Feb 2012 13:16:37 +0000 (14:16 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 21 Feb 2012 13:16:37 +0000 (14:16 +0100)
misc/infrastructure/git-mirror-update.sh [new file with mode: 0755]

diff --git a/misc/infrastructure/git-mirror-update.sh b/misc/infrastructure/git-mirror-update.sh
new file mode 100755 (executable)
index 0000000..fca7ff6
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+#exec >/dev/null 2>&1
+
+mkdir -p /var/cache/git/xonotic
+cd /var/cache/git/xonotic
+ssh xonotic@git.xonotic.org ./send-git-configs.sh | tar xvf -
+
+for X in /var/cache/git/*/*.git; do
+       cd "$X"
+       git config remote.origin.fetch "+refs/*:refs/*"
+       git config remote.origin.mirror "true"
+       git config remote.origin.url "git://nl.git.xonotic.org/${X#/var/cache/git/}"
+       git fetch
+       git remote prune origin
+       git gc --auto
+       touch git-daemon-export-ok
+done