0

I have many web base project that have two layer. front layer and backend layer. both layer files are mixed together. for rendering i cant separate them. front files for all projects are for each project but need git. the base layout for all project always must be sync together.

app/
    cntrl/
        basefile.php [base]
    view/
        baseview.phtml [base]
        thisprojectfile.phtml [front]

enter image description here

  • If i ignore some layer git not work for trace modifying with developers in current layer.
  • If i use branch for each layer another files not be visible to use them.

So what's the solution for this issue ?

1 Answers1

0

You have three choices:

  1. Keep all your code in one repository. You have not defined any reason why you can't do so.
  2. Use submodules to link separate repositories.
  3. Use subtree merging to synchronize separate repositories.

Options #2 and #3 will definitely require more developer effort. Unless you have a good reason to do otherwise, just use the same repository for everything.

If you go with option #1, you can still view the history separately with minimal effort. For example, you could mark front-end commits with "FE: foo" and back-end commits with "BE: bar" to identify them. As long as you are consistent about including the right prefixes, you can run:

git log --grep='^FE:'

to see just the changes to your front-end code.

Todd A. Jacobs
  • 81,402
  • 15
  • 141
  • 199