Alex Vauch
Alex Vauch

Reputation: 301

Files of parent repository inside child repository directory

I have several applications which contain different sets of modules. Modules have such structure:

foo_module
   |-foo.php
   |---views
   |---assets
   |---models
   |---controllers

"Views" and "assets" directories vary depending on the application.

I need "application" directory to be a "parent" repository which contains nested "child" repository (foo_module directory). "Views" and "assets" directories must belong to "parent" repository. Application structure:

application (repository "parent")
   foo_module (nested repository "child")
      |-foo.php
      |---views (belongs to repository "parent")
      |---assets (belongs to repository "parent")
      |---models
      |---controllers

Is there any way to do this without changing the structure?

Upvotes: 1

Views: 192

Answers (1)

VonC
VonC

Reputation: 1324733

One way would be for the parent repository to:

  • reference the children repos as submodules.
  • make symlinks to the right views and assets content in order for said content to be directly accessible from the parent repos main folder.

Symlinks can be versioned, and are available even for Windows (see "Git Symlinks in Windows").

Upvotes: 2

Related Questions