I have a Git repository. In this repository is a directory called core_code
, which contains common code used in several pieces of software (like a common library). There are also directories called program_alpha
and program_beta
, which contain two different pieces of software but are related. Both program_alpha
and program_beta
rely on core_code
to function, and when the software is run, the core_code
needs to be in the program directory. So when I'm running the software, both program_alpha
and program_beta
need to have copies of core_code
within them (for reasons specific to the application, the core_code
must be in the program root and cannot be referenced from somewhere else).
So, I'm looking for a way to have core_code
available in all program_*
directories, but without duplicating it. Initially I wanted to do something like have a symlink in each program_*
directory that points to the core_code
directory, but I'm using the code cross-platform and Git does not hand Windows symlinks well at all. I also must keep all this code in the same repository, so I can't have a separate repo for core_code
and then use submodules in the program_*
directories.
Any suggestions for the best way to do this? It would be so simple if symlinks worked better in Git.