How do I set up a Git project to contains other projects?
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.
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.
I've spent some time trying to understand submodules, but they appear to have too much independence for what is needed.
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?
Is this doable with Git? With Mercurial? Does the host (GitHub, Gitorious) matter?
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.
edit:
To explain why I don't want Submodules:
- When users download, the zip does not include the submodules (here & here).
Ditto when even collaborators try to setup the project. This is a show stopper.
- Submodules are frozen - they do not (easily) pick up the latest version of the project that is being pointed to.
- Other reasons as pointed out in the fantastic answers below and in this monologue at NoPugs.
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.)
Still studying setting up 'remote branches' but other ideas are still welcome.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…