Norayr Ghukasyan
Norayr Ghukasyan

Reputation: 1408

How to properly setup git for multiple projects with shared code base?

I am creating a project where I have 2 repositories that belong to one single project. One of them is the admin part and another one is the main product. Besides, I have shared functionality and assets that are going to be used for both of them. Both admin and product repositories should have their own remote counterpart and both of them should be able to reuse the shared functionality, but none of them should be aware of the other project.

Here is my folder structure

.
├── admin
│   ├── public
│   └── src
├── roulette
│   ├── public
│   └── src
└── shared
    ├── assets
    └── components

My goal is to make sure admin and roulette have their own separate remote repositories with the ability to get access to a shared folder.

Upvotes: 1

Views: 331

Answers (1)

Sarah
Sarah

Reputation: 72

Maybe you can use git submodule to solve this problem.

Make shared as a submodule of other projects, so that they can synchronize recent updates of shared.

You can find more details in here. Hope this will help you~~

Upvotes: 1

Related Questions