summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git-admin-clone27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/git-admin-clone b/scripts/git-admin-clone
new file mode 100755
index 0000000..cc2157a
--- /dev/null
+++ b/scripts/git-admin-clone
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -ue
+
+usage () {
+ echo "usage: $0 URI DEST"
+}
+
+URI="$1"
+DEST="$2"
+
+
+test "x$URI" = "x" && { usage; exit 1; }
+test "x$DEST" = "x" && { usage; exit 1; }
+
+git init "$DEST"
+
+cd "$DEST"
+
+git remote add origin "$URI"
+
+git config remote.origin.fetch '+refs/gitano/*:refs/remotes/origin/*'
+git config remote.origin.push 'refs/heads/*:refs/gitano/*'
+
+git remote update origin
+
+git checkout -b admin origin/admin