Skip to content

Instantly share code, notes, and snippets.

@di3
Created February 28, 2021 19: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 di3/38c05a4e802b496a8c64af9198bc1d84 to your computer and use it in GitHub Desktop.
Save di3/38c05a4e802b496a8c64af9198bc1d84 to your computer and use it in GitHub Desktop.
#!/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