Skip to content

Instantly share code, notes, and snippets.

@poy
Created November 8, 2017 22:35
Show Gist options
  • Save poy/71b74f9c5d72d865e4ae1e8a87d1a588 to your computer and use it in GitHub Desktop.
Save poy/71b74f9c5d72d865e4ae1e8a87d1a588 to your computer and use it in GitHub Desktop.
#!/bin/bash
for i in `ls`
do
for j in `ls $i`
do
repo="$i/$j"
echo $repo
pushd $repo
remote=`git remote -v | grep fetch | awk '{print $2}'`
popd
git submodule add $remote $repo
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment