I have in a folder a large number of projects that I cloned for quite some time; recently I moved this whole folder into one of my repos and would like to convert these cloned p
To add many submodules, I wrote this simple loop:
for repo in vim/bundle/*
do
echo $repo
pushd $repo
url=$(git remote get-url $(git remote))
echo $url
popd
git submodule add $url ./$repo
done
Obvious limitations I didn't bother fixing:
git remote
actually returns all remotes, not just the current, so script will break if there are multiple