Skip to content

devantler-tech/monorepo

🗂️ Devantler's Monorepo

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)

image

Initializing the Monorepo

When you clone the monorepo for the first time, you need to initialize the submodules:

git submodule update --init --recursive

Alternatively, you can clone the monorepo with the --recurse-submodules flag:

git clone --recurse-submodules git@github.com:devantler-tech/monorepo.git

Make 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.

Adding a submodule

git submodule add -b <branch> <ssh-url> <path>

Updating a submodule

There are three scenarios for updating a submodule:

  1. You want to update the submodule to the latest commit on the branch it is tracking.
  2. You want to update a submodule's upstream url.
  3. You want to rename/move a submodule.

Updating to the latest commit on the branch

All submodules are configured to automatically update to the latest commit on the branch they are tracking.

Updating a submodule's upstream url

To update a submodule's upstream url, you need to run the following command:

git submodule set-url -- <path> <newurl>

Renaming or moving a submodule

To rename or move a submodule, you need to run the following command:

git mv old/path/to/submodule new/path/to/submodule

Removing a submodule

./delete-submodule.sh <path>

About

A monorepo to make it easier for me to manage all my active projects.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages