I have a set of related repositories that I want to manage.
The data I want to store are "projects" that consist of "libraries" which consist of "units". Each library is stored in a subfolder of the project, and each unit is stored in a subfolder of a library.
To be able to reuse libraries and units between several projects I plan to store them according to this scheme:
repositories/projects/project1
repositories/projects/project2>
repositories/projects/project...
repositories/libraries/library1
repositories/libraries/library2
repositories/libraries/library...
repositories/units/unit1
repositories/units/unit2
repositories/units/unit...
I'd like to reference the libraries used in a project relatively (say uses ../../libraries/library1
) and to reference a unit in a library also relatively.
Libraries and units can only be modified by modifying a project containing them. So the library and unit repositories could be bare if it's necessary.
The repository on the server should look the same (same layout of folders).
I've already tried using submodules and the "read-tree/subtree merge" approach but couldn't find a way to specify relative urls to repositories in the submodule case and to push changes in the read-tree approach.
What I'd like to accomplish is that if I check out project1, it also fetches all libraries and units necessary and if I change a library or unit through a project these changes can be easily pushed to the server again.