Borek Bernard
Borek Bernard

Reputation: 53352

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

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 ServerSide, ClientSide and 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.

Upvotes: 4

Views: 291

Answers (1)

maxk
maxk

Reputation: 642

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 git subtree

Upvotes: 3

Related Questions