Multiple projects with the same GIT master

In our development environment, we have a custom structure. Although all of our projects begin with a base, it expands on a project based on a project base using plugins and themes.

Folder structure:

  • core (Contains common code between all projects)
  • plugins (each subfolder is a plugin, some of them exist in all projects, some of them are specific to the project)
  • themes (contains only code for a specific project)

We are currently cloning our master repo, deleting the .git folder, creating a new repo and moving on to our changes. If a function or bug is fixed in the project or the main repo, we currently manually combine the changes with various diff tools (mainly winmerge) to ensure that specific themes or project plugins do not fall into the master repo and that the entire project is the last major and common plugins.

I know there should be a better approach to this, perhaps using submodules? the kernel as an auxiliary module, each plugin as an auxiliary module, and each theme as an additional module? Then each project is its own repo?

Or is the structure not the best for this setting?

+2
source share
2 answers

Using an add-on module named PLUGIN for the plugin in the git repository named PROJECT allows these repositories to point to a specific version of the plugin. Therefore, if a plugin evolves in its own repositories, the PROJET developer will have to go into the plugin directory in the PROJECT repository and release

git pull 

to get it. It may be useful to work only with a stable version of the plugins, while they are developed.

In addition, the source history of the plugin is only managed in its own repo. This is a more understandable development scheme.

Using a submodule is also useful if you have a repo containing sets of binary data / data sets with intensive history management. This way it will not slow down your other repositories.

0
source

Use different repositories for your main project and your legacy projects. Your entire inherited project should include your skeleton project as a dependency, maven allows you to handle this.

Each time you update your structure, you should just update your dependencies for each project, no more complex merging

+1
source

All Articles