Files
FSI.BT.IR.Tools/git-remote-init
Maier Stephan SI 1c68b8f401 Sicherung
2023-04-17 07:07:49 +02:00

12 lines
389 B
Bash

#!/bin/bash
gitTop=$( git rev-parse --show-toplevel 2> /dev/null )
[[ "" == "$gitTop" ]] && exit 0
gitRemotes=$gitTop/.gitremotes
[[ ! -e $gitRemotes ]] && exit 0
# if exists added remote repos then exit
[[ "$( git remote -v )" == "" ]] && exit 0
remotes=$(sed '/origin/d' $gitRemotes | awk 'NR%2==0 {print $1";"$2 }')
for r in $remotes ; do
git remote add $(echo $r | sed 's/;/ /')
done