We have a few modules where we have done this and what we essentially did is:
- Setup a Git repo for the module.
- Deploy this module into the codebase of the production site and commit everything including:
- soft-links created by modman
- the .modman directory which houses the cloned module repository
- Use modman to "deploy" it into other versions and/or dev environment for dev and testing.
Doing it this way gets you the flexibility you need for module development, versions the code on the single site as well, and if you make changes to the module in the single-site codebase, you can commit those straight back to the module repository since the repo is is there in the .modman directory.
UPDATE:
When I originally wrote this I failed to take into account in my answer that Git does not allow (sub) modules to be committed to a repository, in which case "committing the everything" kind of needs some elaboration!
Incidentally, this is because I've done this more often using modman to deploy modules housed in Git repos into a production codebase housed by SVN… and Subversion has no scruples preventing it from committing the entire Git tree to the VCS.
So here goes…
If you are using SVN to house the production site's code, you should have no problems since Subversion has (practically) no concept of sub-modules. It won't mind.
If you are using Git for the production site's code, you will have to use sub-modules to "commit everything" to the site's code repository. After using modman to clone something like this:
modman clone ssh://[email protected]/<user>/<repo>.git
You'll also want to add it as a sub-module like so:
git submodule add ssh://[email protected]/<user>/<repo>.git .modman/<repo>
Once you have done this, you should be able to add the .modman directory and .gitmodules file to the index and commit it.
After cloning the repository which is using these modules installed via modman, simply init submodules and update:
git submodule init
git submodule update
P.S. I now use Git full-time on all new projects, so hopefully this oversight won't happen again. Sorry guys. ;)