Skip to content

Instantly share code, notes, and snippets.

@vesh95
Created June 9, 2021 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesh95/6e3401fc6f68dc728769967af473e428 to your computer and use it in GitHub Desktop.
Save vesh95/6e3401fc6f68dc728769967af473e428 to your computer and use it in GitHub Desktop.
#!/bin/sh
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