I'm in the process of setting up a deployment script. The basic process is:
If your submodule is in a repo accessible from the server, I would rather have a post-receive hook which would
git submodule update --init)
git archivefrom that second repo (you would be sure to get the right version since the non-bare repo would reference the right version of the submodule)
git archive-allwould be able to detect the
.gitsubdirectories and would archive everything.
If the submodule isn't accessible from the server, that means: