git-submodule

Adding all existing submodules to a git repo

You have a git repo which contains sub-directories which are git repos themselves and now you want them to become submodules. Here's a quick automatic way to add them all.