Skip to content

Instantly share code, notes, and snippets.

@ianblenke
Created March 3, 2016 03:35
Show Gist options
  • Save ianblenke/086c52a5841cabf8a894 to your computer and use it in GitHub Desktop.
Save ianblenke/086c52a5841cabf8a894 to your computer and use it in GitHub Desktop.
Do a full submodule clone
#!/bin/bash
git submodule update --init --recursive ; git submodule | while read line ; do submodule=$(echo $line | awk '{print $2}'); if [ -f $submodule/.git ] ; then url=$(grep -2 $submodule .gitmodules | grep url | tail -1 | awk '{print $3}') ; rm -fr $submodule; git clone $url $submodule; fi ; done ; git submodule update --init --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment