This repository is a monorepo that contains all my active projects as submodules, effectively bridging a manyrepo and monorepo. This allows me to keep all my projects in one place and easily manage them in VSCode, while avoiding common pitfalls introduced with monorepos (e.g. no repo-per-product, complex release-strategy, overpriviliged access)
When you clone the monorepo for the first time, you need to initialize the submodules:
.claude/scripts/submodule-init.sh --allThis initializes every submodule at its pinned commit and keeps per-worktree isolation intact. A bare
git submodule update --init writes a core.worktree key into each submodule's shared config, which
every later git worktree add inherits — so worktrees silently resolve back into the main checkout and
parallel sessions collide. The wrapper repairs that and verifies isolation before returning; run
.claude/scripts/submodule-init.sh --check at any time to re-verify (a non-destructive probe: it
never touches submodule content or other sessions' worktrees, but does add and remove its own
throwaway probe worktree).
You can also clone the monorepo with the --recurse-submodules flag. That initializes the submodules
the same way, so it breaks isolation the same way — run the wrapper afterwards to repair it (--check
is a non-destructive probe and would only report the problem, not fix it):
git clone --recurse-submodules git@github.com:devantler-tech/monorepo.git
cd monorepo && .claude/scripts/submodule-init.sh --allMake sure that all submodules are checked out on the correct branch the first time you clone the monorepo. Otherwise, you might risk loosing changes as the submodule will be in a detached head state.
Note
Submodules are configured to clone with SSH, so it requires adding your public SSH key to GitHub. You will not be able to clone the submodules with HTTPS. This decision was made, as HTTPS will require authentication on every request, where as SSH can do this automatically when the public key is shared.
git submodule add -b <branch> <ssh-url> <path>There are three scenarios for updating a submodule:
- You want to update the submodule to the latest commit on the branch it is tracking.
- You want to update a submodule's upstream url.
- You want to rename/move a submodule.
All submodules are configured to automatically update to the latest commit on the branch they are tracking.
To update a submodule's upstream url, you need to run the following command:
git submodule set-url -- <path> <newurl>To rename or move a submodule, you need to run the following command:
git mv old/path/to/submodule new/path/to/submodule./delete-submodule.sh <path>