Skip to content

Instantly share code, notes, and snippets.

@yene
Last active August 29, 2015 14:02
Show Gist options
  • Save yene/0a1fb83a25831499ec82 to your computer and use it in GitHub Desktop.
Save yene/0a1fb83a25831499ec82 to your computer and use it in GitHub Desktop.
#!/bin/bash
/usr/bin/ssh git@op6 expand > repos.txt
myarr=($(awk '{print $NF}' repos.txt))
counter=0
for i in "${myarr[@]}"
do
counter=$(($counter+1))
if [ "$counter" -eq 1 ] || [ "$counter" -eq 2 ]
then
continue
fi
/usr/local/bin/git clone --mirror git@op6:$i $i
/usr/local/bin/git --git-dir $i remote update
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment