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/Ashould update bothA.gitandProjects.git's information aboutA. Anything related toBshould be ignored since it's inactive and locally empty - Activate project
B, cloning that as well - Now any
git-push/pullinProjectsshould also do so in bothAandB, while a push/pull inAshould not influenceB - Deactivate project
A, which (after verifyingA.gitdoesn'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.