0

Short Question: I Want to have multiple remotes in my Git repository, however each remote only has (is responsible for) certain file groups in the project.

Long Story! : I have a JS platform/framework (Handles general stuff like auth, administration, http fetch, application theme, general layout, ...). I want to use this as base for my different project. The Framework has its own Git repo and remote and I may improve things in framework and push them to its remote every now and then.

Let's say I have Project A and Project B which both are using the Framework as base and they each have got their own repository. Project A and B have got their own specific files which can be changed and committed to their repo and remote. I want specific projects only be able to pull data from the Framework remote and not be allowed to make changes there.

I know I can add multiple Remotes and I know that I can disable the "Push" for the framework Repo. However the issue is that everytime I pull from framework Repo it wants to delete all project specific files.

A. Is this possible? if yes how?

B. Is this the best approach or would you recommend another model to main this type of project?

Asha
  • 3,871
  • 7
  • 44
  • 57
  • You might be looking for git submodules or subtrees. You might find [this question](https://stackoverflow.com/q/31769820) interesting. – Hasturkun Oct 22 '18 at 10:00
  • Git is organized around *commits* (not files—files merely come along for the ride when a commit gets used). Hence, if you wish to have this kind of separation, you need to establish the separation between *commits*. In general, that means using two separate repositories. – torek Oct 22 '18 at 14:28
  • @Torek How do you recommend to organize such commits? Would you suggest to leave it to devs to not commit anything to the Framework whilst they can Pull the latest changes to their project from the framework? Thx – Asha Oct 22 '18 at 15:22
  • I know nothing of this particular framework / project split, but see the question that @Hasturkun linked. – torek Oct 22 '18 at 17:27

0 Answers0