An open API service indexing awesome lists of open source software.

https://github.com/devantler-tech/monorepo

A monorepo to make it easier for me to manage all my active projects.
https://github.com/devantler-tech/monorepo

metadata

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 🗂️ 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:

```bash
git submodule update --init --recursive
```

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

```bash
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

```sh
git submodule add -b
```

## 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:

```sh
git submodule set-url --
```

### Renaming or moving a submodule

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

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

## Removing a submodule

```sh
./delete-submodule.sh
```