Help organize multiple React projects within a single GitHub repository, ensuring each project has i

My Folder Structure Goal (Visual): React-Learning/ │ ├── Classroom-Project/ │ ├── todo-list/ │ ├── counter-app/ │ └── another-project/ │ └── Assignment-Project/ ├── simon-game/ ├── quiz-app/ └── another-assignment/ My ISSUE: I’ve created this folder structure in one GitHub repo called React-Learning. Each project (like todo-list) is inside its own folder. The problem is: When I commit code inside todo-list, the commits show up in the main repo (React-Learning) commit history — not per project. So after a few months and many projects, I can't easily track which commit was for which project. It gets confusing What I Want: I want to organize multiple small React projects in one place. I want to clearly track commits per project (e.g., commits for todo-list should be grouped or easy to filter). Should I: Keep all projects in one repo? Create a separate repo for each project? What are the best practices as a beginner?.
4 Replies
Ganesh
Ganesh2w ago
I'm not much experienced with git but from what I know you would use git submodules which let's you track the nested repositories separately. https://git-scm.com/book/en/v2/Git-Tools-Submodules However mostly everyone I asked before discouraged this and told me to keep unrelated projects in separate repos (them being react doesn't make them related. Related projects would be something like backend api and the frontend of that api) Maybe someone who's experienced with submodules can elaborate better
Myra
MyraOP2w ago
@Ganesh Thanks a lot for the detailed answer! That really helped clear things up.
13eck
13eck2w ago
I second separate repos. I’ve not used sub-modules before but I’ve not heard anything positive about them, either
Jochem
Jochem2w ago
thirded there's very little reason to not have separate repos, unless your host somehow limits you to a single one, and no good reason to keep separate projects in the same repo even submodules is intended to keep related projects together in one repo

Did you find this page helpful?