From f6441f7f12e6ea40e52e143711f6b6ee2bcbce66 Mon Sep 17 00:00:00 2001 From: Toby Batch Date: Thu, 8 Oct 2015 16:16:36 +0100 Subject: [PATCH] New re-cloner script --- reclone | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 reclone diff --git a/reclone b/reclone new file mode 100755 index 0000000..84d60bf --- /dev/null +++ b/reclone @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ -z "$1" ]; then + _PATH=`pwd` +else + _PATH=$1 +fi + +for GIT in `find $_PATH -type d -name .git`; do + URL=`git -C $GIT config --get remote.origin.url` + TARGET=`dirname $GIT` + mv $TARGET `dirname $TARGET`/_`basename $TARGET` + git clone $URL $TARGET +done