views:

109

answers:

2

Here's the situation: there are 9 sites, they all share a similar codebase, but there are differences:

  • Type A: 2 of them could be considered "social" sites (events, news, profiles, login)
  • Type B: 3 of them are your regular sites (events module, news, etc)
  • Type C: 4 of them are small "brochure" type sites (just pages and a contact form)

Now I was thinking about an efficient way to deploy those sites.

If I make a change to one of those sites, sometimes it would apply to a single site only, sometimes to both type A sites. Some changes would affect all type A and B sites and so on.

I am looking into getting this to work with git. How can I efficiently deploy changes across multiple folders?

I tried creating branches for A, B, C but I have a gut feeling that's not really the solution. For example, if file xxx.txt exists in branch A, and I switch over to B, it's still there.

I think I should determine which files are shared and which ones are not and then find a way to mix and match it all together.

all-sites
|-- a
|-- b
|-- c
`-- static
A: 

Why not just have subfolders for each of your projects?

Global
|---GlobalA
|   |
|   SiteA1
|   |
|   SiteA2
|
|---GlobalB
|   |
|   SiteB1
etc...

This sounds like it would fit better with the inheritance scheme that you're trying to use.

samoz
+1  A: 

Sounds like you want to use submodules with a repo structure such as:

  1. code common to all sites

  2. code common to Type A sites, but not in (1)

  3. code common to Type B sites, but not in (1)

  4. code common to Type C sites, but not in (1)

  5. Site 1 (Type A)

    • submodule points to (1)
    • submodule points to (2)
  6. ...
Greg Bacon