Git + GitHub + Heroku Git + GitHub + Heroku heroku heroku

Git + GitHub + Heroku


The idea behind submodules is that they're all separate git repositories that you can include into a master one and rather instead of including all the files it includes a link to that submodule instead.

How to use submodules

To use a submodule, first you must extract out the directory and create it as its own git repository by using git init. Then you can upload this separately to Github or [place of your choosing] and to use it as a submodule use the command: git submodule add [place/to/put/it] git://github.com/you/proj1.

Separation is best

I would think it better to leave these separated out as their own git repositories and push to heroku from each one. The reason? It's more likely (I feel) that you're going to be working on one at a time and doing a git commit and git push heroku master for that one only.

If you wished however to deploy all applications at the same time you could recurse down the directory tree using this Ruby script placed in the top-level directory:

Dir["**/*"].select { |dir| File.directory?(dir) }.each do |f|  Dir.chdir(dir) do    `git push origin master`    `git push heroku master`  endend

Of course this would only work if you have staged all your changes. I can't think of a way to automate that as Ruby <= 1.9 doesn't have the module to read your thoughts.