How to make GitHub project part of a larger solution on a repository level?
I’m doing a project that will have these 3 components (all working together):
- Custom server-side code
- Custom client-side code
- One 3rd party library that is a GitHub project (BSD licensed)
As part of the development, it is likely that I will make changes to the 3rd party library project and that I will want to contribute my changes back to the project owner, preferably via GitHub fork / pull request.
The question is, how do I structure my repository (repositories) if I don’t want it to be entirely open-source and hosted on GitHub? If it were 100% closed-source, I would have one repository with 3 main folders, something like
LibraryXY but I guess copying the contents of the 3rd party library to
LibraryXY would make it difficult to contribute changes to it back to the project owner on GitHub.
One Solution collect form web for “How to make GitHub project part of a larger solution on a repository level?”
You can use either
git submodule or
git subtree commands.
A submodule in a git repository is like a sub-directory which is really a separate git repository in its own right. This is a useful feature when you have a project in git which depends on a particular versions of other projects. see details
Subtrees allow subprojects to be included within a subdirectory
of the main project, optionally including the subproject’s
entire history. For example, you could include the source code for a library
as a subdirectory of your application. see details
Based on your project structure, I would suggest you use