This is a question that seems to come up semi-frequently, but sadly I've not found an answer that I can fully apply to my situation yet, so I figured I'd ask my own question. This is my first question on SO, so be nice. :P
The "problem": Our company develops multiple PHP applications, however one of those applications is a "master" of sorts. All of our other applications is installed inside this "master application", and requires the master application to work.
We use version-control to manage these applications, of course.
While many of the files in our addon applications are in subdirectories, not all of them are. This means that we cannot use subdirectory importing (svn externals, git submodules, etc.). For instance, within the root folder there are several folders (admin, public, kernel and so on) and the addon applications have files within one or more of these folders - they are not independently self-contained within the directory structure of the master application.
We currently use SVN and recently found ourselves considering git due to some of the features available we feel could be useful to us. One thing I'm not clear on with git, however, is if there is truly a way to "merge" (not in the version control sense) these repositories into a single directory locally when developers are working on the code. I have not found a way to do this with SVN either.
In an ideal world, we would have one repository for our "master" application with a structure like so:
- /
- --file1
- --file2
- --/admin
- ----file1
- ----file2
- --/public
- ----file1
Our addon application would have a structure like so (remember, we have multiple addon applications):
- /
- --filex
- --/admin
- ----/myapp
- ------file1
- ------file2
- --/public
- ----filex
We have experimented with the following approaches, each with its own caveats:
- All applications in a single repository. This is less than ideal as it becomes a nightmare managing versions for each application effectively (especially in SVN). Branching and tagging take along files from unrelated and separate applications.
- All applications in a separate repository. This is also not ideal (well, it is from a management/organization perspective) because you cannot export two separate repositories to a single folder, so you always work with a checkout of one repository and an export of others. If you are working on application X and there are changes in our master application, you need to manually do a new export of that master application and copy the files over to the application X repository you are working on to have the latest framework code.
Is there any way with git or SVN (or any other version control system for that matter) to allow more than one repository within a single directory without using subdirectories? SVN externals is nearly perfect, but has the requirement that all files in the external repository be in a separate subfolder, which as described above does not work for us. I gather git has equivalent capabilities, but again cannot allow more than one repository in a single folder, leaving us with the same issue.
Related questions: Multiple repositories in one directory (same level) - is it possible? - this is very close to what I am asking I think, but I did not see any solution that I felt could be applied to our situation.