Git Submodule or Plug

I have a private repo on github which is the complete source code for my cms. Now I have several local clients that I want to use the same code base, but with different themes. Is it better to put the original project in the repo for each of them. Or use a submodule and create a new repo for each client?

After each site is completed, I would suggest that the theme files will not change much, but if they find errors, they will need to make changes to the main repo.

+7
git github git-submodules fork
source share
1 answer

Since there are two sets of files (general and theme files), then submodules are suitable.

Each client will have:

  • main git repo project
    • one submodule cloning a common code base
    • one submodule with specific files for its theme.

Forking is more of a cloning method that can isolate one version of a repo from its copy.
GitHub implements it with a fork queue to make cherry picking easier with some changes made to the forked git repo.
But the main thing here: this applies to the entire repository, and not just one part.
If several parts are involved, then submodules are suitable.

+4
source share

All Articles