Skip to content

Instantly share code, notes, and snippets.

@elken
Last active January 1, 2016 15:09
Show Gist options
  • Select an option

  • Save elken/8162595 to your computer and use it in GitHub Desktop.

Select an option

Save elken/8162595 to your computer and use it in GitHub Desktop.
Script to add all submodules from a given file (could be edited to fit needs but I cba)
for i in `cat tmp`; do
git submodule add https://github.com/$i bundle/$(echo $i | cut -d "/" -f2);
git submodule init;
git submodule update;
cd bundle/$(echo $i | cut -d "/" -f2);
git checkout master;
git pull master;
cd ../..;
git add bundle/$(echo $i | cut -d "/" -f2);
git commit -m "Added submodule: $(echo $i | cut -d "/" -f2)";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment