Git – Source control with multiple customer-specific repositories

branchinggitrepositoryversion control

Source Control

Here is a diagram of how our source control setup is configured.

The issue with this setup is how we handle various customers. I would really like to use a different approach than copying the entire baseline for each of our customers. I think further down the road this will become a major problem to maintain.

How can this be best achieved? Any help insight would be greatly appreciated.

Best Answer

Some options:

  • Put only the customisations in separate repos and just copy them over the original repo when building the deployable. This is only feasible for superficial differences such as theming; once you have code patches in there it very quickly gets unmanageable.
  • Develop separately and merge changes which should be in both repos. This might seem like a good alternative until you have changes which you need to pull apart manually, line by line, to ensure that the repos each do what they want. This work just gets worse and worse with every merge, until inevitably the merges are too expensive to continue. Now everything is duplicate effort.
  • Make the customisations configurable, and put only the configuration in separate repos. This makes it much easier to handle code differences, since they are just feature toggles. The overhead of the switches is much more manageable than the other options unless they go completely out of control (and even then it's generally easier to just prune toggles than to do manual merges forever).
Related Topic