--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 origin" >&2
+ exit 1
+fi
+
+origin="$1"
+local_repo="`basename \"$origin\" .git`"
+
+if [ -d "$local_repo"/.git ]; then
+ cd "$local_repo"
+fi &&
+
+if [ -d .git ]; then
+ git remote set-url origin "$origin"
+else
+ git clone -o origin "$origin" "$local_repo" &&
+ cd "$local_repo"
+fi &&
+
+pwd >> "`dirname \"$0\"`"/locate-all.list &&
+
+chmod a-x .git/config &&
+branch="`git rev-parse --abbrev-ref HEAD`"
+
+git config push.default current &&
+exec git gc --aggressive