#!/bin/sh GITHUB=https://github.com/nprobert PSTAR=https://www.probestar.com/NTCNA-TP for i in * do echo "$i: " if [ -d $i ]; then cd $i git ls-remote --get-url | grep www.probestar.com if [ "$?" -eq "0" ]; then cd .. continue fi cd .. fi if [ ! -d $i.git ]; then git clone --mirror $GITHUB/$i.git cd $i.git git remote add new $PSTAR/$i.git git push --mirror new cd .. rm -rf $i.git fi if [ -d $i ]; then cd $i git remote set-url origin $PSTAR/$i.git git pull --recurse-submodules cd .. else git clone $PSTAR/$i.git --recursive fi done