Recommended workflow for multiple modules (topics)

I have an application (cms), the structure of which looks like this:

BASE:
    /application/
    /public/
        themes/
           default/
           mobile/

This is the basic, central repository for all of our projects. Then the projects get their own skin: (which are based on the topic /default/)

CLONE1:
    /application/
    /public/
        themes/
           default/
           mobile/
           own/
           ...
           own-theme-12/

(This app has 12 customizable themes based on the standard one).

The thing is to support applications and constantly update CLONES using BASE.

Now we add BASE as a remote repo:

(/clone1/)$ git remote add base-repo /path/to/base.git

Then pull out the updates if necessary:

(/clone1/)$ git pull base-repo develop

When the files .phpare /applicationchanged, everything works fine. The problem begins when we modify the files in the tag defaultin the BASE repository (for example, a typo in reset.css). We need these changes in the topic CLONE1/defaultand all topics CLONEx/own-x/.

, bash script, , , ?

git flow. default mobile . ? .

, ?

+3
2

git-subtree, . , , , : . , .

: , / git -subtree. , , . , - :

    /app/code/*.php
    /app/themes/default/
    /app/themes/mobile/
    /themes/default -> ../app/themes/default
    /themes/mobile -> ../app/themes/mobile
    /themes/own-1/

, -

    git subtree split --prefix=app --rejoin
+2

, , , , .
( ). , - SCM.

script, , :

  • BASE/default local/default
  • , (, reset.css ).

, , - .

+1

Source: https://habr.com/ru/post/1786109/


All Articles