Given a tree of git repositories in a project directory, e.g.
Projects/
+A/
|+.git/
+B/
|+.git
I'd like to set up a git repository Projects.git
that does not track the project's contents but only their existence and status. Someone cloning this repository should only have a sekeleton of uncloned repositories A
, B
etc. and individually activate whether they are kept in sync or not. A typical workflow would look like this:
- First time setup:
git clone server:Projects.git
- Activate project
A
, which also clones it - Now every
git-push/pull
, independently of whether it's inProjects/
orProjects/A
should update bothA.git
andProjects.git
's information aboutA
. Anything related toB
should be ignored since it's inactive and locally empty - Activate project
B
, cloning that as well - Now any
git-push/pull
inProjects
should also do so in bothA
andB
, while a push/pull inA
should not influenceB
- Deactivate project
A
, which (after verifyingA.git
doesn't need agit-push
) empties the local directoryA
, with no influence onProject.git
How can this be treated best? My current approach would be some hook-magic, but I'm not familiar enough with git submodules to see whether this could be achieved with submodules or whether I need to use some other solution.