Organizing Multiple Study Repositories with Git Submodules
How I use Git Submodules in my studies repository to group PHP, SQL, JavaScript, and tooling experiments under one roof while keeping separate Git histories.
When you study multiple topics in parallel—PHP basics, SQL exercises, API experiments, and browser automation—it is easy to end up with scattered repositories or one giant folder with tangled commit histories.
To keep everything indexed in one place while keeping each repository independent, I organized the studies repository (https://github.com/rniguel/studies) with Git Submodules.
What Are Git Submodules?
A submodule lets you embed one Git repository inside a subfolder of another repository while keeping their commit histories separate. The parent repo simply tracks each subproject's remote URL and pinned commit hash inside .gitmodules.
Real .gitmodules Layout
In studies, projects are grouped by stack (php/, sql/, javascript/, tools/):
[submodule "php/php-course-brocode"]
path = php/php-course-brocode
url = https://github.com/rniguel/php-course-brocode.git
[submodule "sql/sql-course-brocode"]
path = sql/sql-course-brocode
url = https://github.com/rniguel/sql-course-brocode.git
[submodule "javascript/fallback-api-cep"]
path = javascript/fallback-api-cep
url = https://github.com/rniguel/fallback-api-cep.git
[submodule "tools/github-speckit-starting"]
path = tools/github-speckit-starting
url = https://github.com/rniguel/github-speckit-starting.git
[submodule "tools/playwright-linkedin"]
path = tools/playwright-linkedin
url = https://github.com/rniguel/playwright-linkedin.gitDay-to-Day Commands
# Add a new study repo inside a category folder
git submodule add https://github.com/rniguel/fallback-api-cep.git javascript/fallback-api-cep
# Clone the parent repo together with all nested repositories
git clone --recurse-submodules https://github.com/rniguel/studies.git
# Pull the latest commits for every submodule
git submodule update --remote --mergeFinal Thoughts
If you want a central hub for your learning projects without giving up standalone repositories and deploys, Git Submodules keeps everything tidy.
Miguel Riquelme
Front-end Engineer. Software Engineering MBA student at USP/Esalq.