Is there a clean way to maintain multiple systems with certain overlapping files?

We have several systems and some of them have files that are used by multiple systems.  I believe that I could create multiple branches and simply never use the master branch, but this seems dangerous - what if someone commits to master.  It’s also a little confusing.  Is there a built in way to maintain this kind of design?  Here is a brief diagram:

System 1 - files and functions unique to industry A.

System 2 - files and functions unique to industry B.

General Files - Files are generic and used by both System 1 and 2.


I am not 100% sure if I understand your question correctly.

Also the question is maybe slight out of context of git/GitHub but anyways, let me give it a shot :slight_smile:

I suspect that the files/functions you are talking about are somehow loaded on the respective target systems 1 and 2?

What people often do in scenarios like you are describing:

* a load script that can load the required files

* an environment variable that indiciates which system the load script is executed on (e.g. TARGET_SYSTEM=“system1”)

* the load script will then read the environment variable, and only load the files required for the specified system

What you achieve by this is that you can just commit all files to the /master branch of your git repo, and let the load script take care of loading the correct files for the given system.