Reputation: 23
The title is probably a little misleading, because i'm not sure what to name it.
We've created a webbased system that we sell to our clients. We do all the hosting and what not. Incase we have a new client that bought the system, we copy one from a different customer and change the logo's, etc.
Now if we made changes, lets say we found a bug and fix it, we have to go through all the systems and change the file that had the bug. And this is something that i'm looking at changing.
Basically what i'm looking for is a easy way to keep this organized and easy to push to production. But also want the flexibility to, if a client wants a specific feature, that we're able to easily change it, instead of updating every system with this feature.
So whenever we make a change in the core of the system, I would like to somehow push over the fixed file to all other systems, instead doing it manually, which is kind of a hassle and stupid way of doing it.
Now I thought this is possible with git, through some kind of branch construct that would merge into a main branch, but i'm not too certain about this and can't find anything about it.
Does anyone know what this is called or is there a way to do this?
Upvotes: 1
Views: 64
Reputation: 28370
You may wish to look into post commit hooks - you could have a list, (maybe a python dictionary), of which branches are in which customers areas and and whenever there is a commit you could, if it is specific to one customer, pull & update their directories but if it is in the trunk you could automatically do a pull and update in all the customers directories.
The git book chapter on hooks is here and has several examples.
Upvotes: 0
Reputation: 124646
This should be possible with any version control system, not only Git.
Let's say your core system is in the master branch. Create a new branch for each customer.
If you discover a bug in the core system, fix it in master, and merge master into all customer branches.
In the meantime, you can have unique changes in your customer branches. However, if for example you changed index.php
in a customer branch, and then later you fixed a bug in that file in master, then when you merge master into the customer branch, you may get conflicts, which you will have to solve manually.
And, since each customer branch is specific to your customer with unique custom changes, you should not need to merge from a customer branch to master. You will always marge from master to the customer branches, never the other way around.
If you make only minor changes and bugfixes in the core system, then this setup should work fine, with occasional minor conflicts. But if you make extensive changes to the core system, you may get so many conflicts that will make the setup too hard to maintain. It all depends on the overlap of the unique changes in customer branches and the master branch. If there is little or no overlap, then even extensive changes could be easy to merge.
Upvotes: 1