So I have 3 repositories to clone. Im passing repository name as an array, Suppose Repos=("A" "B" "C"). The issue is that I want to run the 1st and 3rd cloning loop with checkout branch as develop and 2nd as master.
git_setup() {
URI=path_to_repo
arr=("$@")
for i in "${arr[@]}";
do
"git clone" "$URI/$i" "--progress --verbose -b develop" | tee -a $LOGFILE
done
}
Repos=("A" "B" "C")
git_setup "${Repos[@]}"
I am Looping this because I have different values of A,B,C depending on the Environment. I thought of creating master and develop checkouts as variables and then passing through loop. Is it possible ?