1

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?

Alex Vauch
  • 191
  • 1
  • 6
  • 1
    Can you be more clear about what you are trying to do -- maybe show a diagram of what you want the final repository to look like? I'm unclear whether you want `views` and `assets` directories to belong to one repository and `foo_module` and `foo.php` and `controllers`, etc. to belong to another repository. I'm also unclear about what you mean by parent and child repositories in the context of git. – eebbesen Dec 07 '13 at 16:43
  • I've edited the question for more clarity. Some times files inside "views" and "assets" need to be modified for a particular application. This dirs contains view templates/images/js. Controllers/models/foo.php - "core" files of module, does not depend on application. "Child" - i mean nested. – Alex Vauch Dec 07 '13 at 17:56

1 Answers1

2

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").

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250