Repository tools
This commit is contained in:
34
bin/repo-move.sh
Executable file
34
bin/repo-move.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/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
|
||||
15
bin/repo-update.sh
Executable file
15
bin/repo-update.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
PSTAR=https://www.probestar.com/PStar
|
||||
|
||||
for i in *
|
||||
do
|
||||
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
|
||||
Reference in New Issue
Block a user