Created
July 2, 2012 00:27
-
-
Save mehlah/3030170 to your computer and use it in GitHub Desktop.
Batch git submodule add
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/sh | |
set -e | |
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | | |
while read path_key path | |
do | |
url_key=$(echo $path_key | sed 's/\.path/.url/') | |
url=$(git config -f .gitmodules --get "$url_key") | |
git submodule add $url $path | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect tool :)
Very thanks.