Created
May 10, 2011 21:43
-
-
Save docteurklein/965444 to your computer and use it in GitHub Desktop.
init submodules from a .gitmodules file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for cfg in `git config -f .gitmodules -l` | |
do | |
url=`echo $cfg | awk -F"submodule.*.url=" '{print $2}'`; | |
if [ -n "$url" ]; then | |
echo "git submodule add $url $path"; | |
git submodule add $url $path; | |
url=""; | |
else | |
path=`echo $cfg | awk -F"submodule.*.path=" '{print $2}'`; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment