3 #=======================================================================
5 # File ID: 0ecaab8c-e677-11e4-8c39-000df06acc56
7 # Create repositories in /media/seagate-3tb/repos/Git-other/
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
15 # Set to "echo" to simulate things
19 f
="$(echo -n $f | sed 's/\/$//')"
23 echo ========== $f ==========
24 searepo
=/media
/seagate-3tb
/repos
/Git-other
/$f.git
25 origin
="$(git config --get remote.origin.url)"
26 test -d $searepo ||
$simul git init
--bare $searepo ||
{
27 echo $progname: $searepo: cannot initialise repository
>&2
30 test -z "$(git config --get remote.seagate-3tb.url)" && $simul git remote add seagate-3tb
$searepo
31 $simul git merge
--ff-only
33 $simul git push
--all seagate-3tb
34 $simul git push
--tags seagate-3tb
36 git remote
-v >>$searepo/remotes.txt
37 sort -u $searepo/remotes.txt
>$searepo/remotes.txt.tmp
38 mv $searepo/remotes.txt.tmp
$searepo/remotes.txt
41 $simul cd $searepo && (
42 test -L /bellmann
&& (
43 test -z "$(git config --get remote.bellmann.url)" &&
44 test -d /bellmann
/home
/sunny
/repos
/Git-other
/$f.git
&&
45 $simul git remote add bellmann
/bellmann
/home
/sunny
/repos
/Git-other
/$f.git
47 test -z "$(git config --get remote.bellmann-src.url)" &&
48 test -d /bellmann
/home
/sunny
/src
/other
/$f &&
49 $simul git remote add bellmann-src
/bellmann
/home
/sunny
/src
/other
/$f
51 test -z "$(git config --get remote.origin.url)" && test -n "$origin" && $simul git remote add origin
$origin
56 ) ||
echo $progname: $f/.git
: directory not found
>&2