Sreekanth Reddy Balne
Sreekanth Reddy Balne

Reputation: 3424

How to use a Git repository with multiple projects?

I'm new to Github. Was unable to find a tutorial regarding this.

How to implement this?

core-modules/
    module1/
    module2/

project1/
    folder1/
        core-modules/
            module1/
            module2/

Note: Please comment before downvoting. As well point towards a valid solution.

Upvotes: 1

Views: 626

Answers (1)

VonC
VonC

Reputation: 1329452

One possible solution is to use submodule in order to:

  • define one "parent" repo per project
  • one submodule for the actual project repo (your current "individual repos")
  • one submodule for the core-repository

That is:

parent (one repo)
  core (one repo)
  src (one repo)
    core -> ../core

Once cloned, you still need to make a symlink from inside the source project repo to the core-repo folder.

If the core-repo has new commits, a simple git submodule update --remote inside each parent repo is enough to get those new commits inside the core submodule.

Upvotes: 1

Related Questions