I added a submodule:
git submodule add git://github.com/chneukirchen/rack.git rack
A file .gitmodules
was created like:
You need to run
git submodule update --init --recursive
UPDATE:
the submodule add command actually clones the entire repo and adds the sha1 to the index.
This may be new behaviour as compared to previous versions of git, the clone was not done immediately.
If you don't have an entry in the index pointing the module to a particular commit, git submodule update refuses to do anything. This seems to be new behaviour.
Hope this helps.