Is there a better proposal to version control web-projects with small random updates in several customer projects with git?
I want to use git to version control for web projects. The main difference to almost all other proposals are that this is a web project using HTML, JavaScript and some PHP files - no central libraries used by one ore more programs, like usual in typical Linux packages.
All my different web projects are for different customers basing on the same platform files, I would estimate 80% of the files are identical (call them platform) and 20% are modified for different customers to fit to their needs. Problem here is, that I don't know for which files we need a customer update - in detail every customer is different.
Best would be to keep the platform specific files in one directory and overlay these files with customer specific files in another directory. To solve this with git I found nothing really good so far:
- git submodule (like proposed here) typically designed to have the sources of a vendor developed library close to the program who link it. Therefore the problem is that the platform and the customer files are in different directories, so I have to mix them during deployment to create the files for the web-server. Furthermore I have to keep the directory trees in sync manually and that would be a hell a lot of work with 10 directory deep hierarchies. In general a lot of postings grumble about the big administrative effort using submodules, it looks like it is overkill.
- git subtree (like proposed here) seems to be simpler than submodule but suffers from the same problem with different directories, so I also need to keep the dir structure in sync and mix the files during deployment. Furthermore it is difficult to push platform changes back from customer repo.
- GitSlave (like proposed here) I'm not sure whether this can be of benefit for me. It allows keeping several git repos in sync, maybe it helps syncing the dir structure of platform, but I can't believe it
- Refactor between platform and customer files in different directories (like the result of this discussion) I think this is simply impossible in case of my customers and the technology used by web projects. For one customer this page need an update, for another that page. Even when introducing a PHP-framework the customer specific changes are spread over the whole tree.
- Checkouts (like also proposed in this discussing in the last posting) This looks very simple and promising, with the drawback that all the customer specific files are outside of git (so outside of version control). Furthermore in case a file is updated in platform and in customer, the git pull fails - it aborts, so this is not usable
- Vendor Branches (like recommenced here) as I have learned, branches are made to be merged back, and that is not aimed for my customer specific patches. These branches would be always open, only merged after an update from the platform (main) towards customer. And this will lead to a mega-lit repo keeping all customers and the platform information - not the git way of handling repos.
- Mix during deployment. So a very pragmatic method of keeping the platform files in one repo and the customer files also in dedicated repos. During deployment of the files to the web-server, it can first write all platform files and than overwrite some of them by the platform specific files. The mixture happens very late in the web servers directory. This also have the drawback that the directory structure of each customer have to be manually kept in sync with the platform structure - otherwise the deployment would be too complex.
What is the best approach here?