Advice on how to structure projects (new to Github)

I’m new to Git and have a question about how to structure projects. Most of my development projects use a framework combined with application-specific files underneath. So, the directory structure for a project ends up looking something like this:

project/

project/someFrameworkFile.ext

project/someProjectFile.ext

project/someFrameworkDirectory

project/someFrameworkDirectory/projectFile1.ext

project/someFrameworkDirectory/projectFile2.ext

project/someFrameworkDirectory2/

project/someFrameworkDirectory2/projectFile1.ext

project/someProjectDirectory/

project/someProjectDirectory/projectFile1.ext

etc…

In short, my projects all have a consistent directory structure dictated by a framework, but a mix of both framework-specific files and project-specific files. Is there a strategy I can use in Git where I can have a framework project separate from the project projects, and then point those project projects at specific versions of the framework, thereby saving me from having the framework files duplicated across dozens of projects? Or does my directory structure make such an approach impossible?

Thanks!

1 Like

Hi @farfromglorified,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.

Cheers!

Unfortunately, because your project and framework files are all mixed together, the typical Git solution of using submodules won’t work. This also is why many modern frameworks use package managers such as npm for their installation and updating. If the framework could be rearchitected to follow one of the above patterns, that would most likely be ideal.

I hope that helps!

1 Like