Files

22 lines
612 B
Bash
Executable File

#! /usr/bin/env bash
function sub_akt() {
#$1 ist Branch
#$2 neue URLD
new_sub_url="$2"
git checkout $1
i=0
for path_check in $(git config --file=.gitmodules --get-regexp path|awk '{print $2}'); do
new_sub_path="$3"
if [ $path_check = $new_sub_path ]; then
echo "$path_check = $new_sub_path"
git submodule set-url $path_check "$new_sub_url"
git submodule update --init --recursive --remote $path_check
git add .gitmodules
git commit -m 'Submodul aktualisiert'
git push
else
echo "keine übereinstimmung"
fi
done
}