title: Projects within projects using Git
body: <p>How do I set up a Git project to contains other projects?</p>
  
  <p>eg. I am working on an online mapping app.  We developed a GPS tool together with an outfit in SF.  We simultaneously developed a Python Geomapping script together with a different concern (that only cares about geomapping).  Our own core files unite the two, and build upon them for the app we need.</p>
  
  <p>Each of the projects must exist by itself - the folks that have interest in the GPS only have interest in GPS - but the "parent" project which includes all of the others must be accessible as a project.</p>
  
  <p>I've spent some time trying to understand submodules, but they appear to have too much independence for what is needed.</p>
  
  <p>Also, if possible, it would be nice if each of those projects could contain one or two overlapping scripts.  Could one Git project include a file that is not part of its 'root' so that when this file is updated by either team both can benefit?</p>
  
  <p>Is this doable with Git?  With Mercurial?  Does the host (GitHub, Gitorious) matter?</p>
  
  <p>I have the idea of using Subversion for the 'parent' - ignoring the .git folders, and using Git for the projects (ignoring .svn folders) - but that is only a last resort.</p>
  
  <p>edit:</p>
  
  <p>To explain why I don't want Submodules:</p>
  
  <ol>
  <li>When users download, the zip does not include the submodules (<a href="http://support.github.com/discussions/site/354-why-does-downloading-a-project-not-download-submodules" rel="noreferrer">here</a> &amp; <a href="http://support.github.com/discussions/site/110-downloads-dont-include-submodules" rel="noreferrer">here</a>). 
  Ditto when even collaborators try to setup the project.  This is a show stopper.</li>
  <li>Submodules are frozen - they do not (easily) pick up the latest version of the project that is being pointed to.</li>
  <li>Other reasons as pointed out in the fantastic answers below and in this <a href="http://nopugs.com/2008/09/04/why-ext" rel="noreferrer">monologue at NoPugs</a>.</li>
  </ol>
  
  <p>Subtree-merging (introduced to me by Paul, below) will not do:  It is difficult to update the source [of a subtree] from within the project it is merged into, and that source must reside outside of the 'root' folder of the project.  Being a web app, it is vital that all my pages link internally to a folder within them, and that testing and updates be done directly within that folder.  (Hope this is clear and useful to others.)</p>
  
  <p>Still studying setting up 'remote branches' but other ideas are still welcome.</p>