views:

42

answers:

2

I have made a little framework for php. In this project I have the basic functionalities that I use for most of my projects. I have also inserted some sample data so I do not forget how it all works again.

I have put the framework under version control using git. Everything works fine now and I want to further build on this. This is my first git project so I do not know which method I should use.

Ok the first thing I want to do is creating 2 more versions of the project. As I explained before the version I have now has some sample data inside it.

So the first version I want to create is a stripped down version, removing the sample data. I can use this version to create any new project.

The second version I want to create is an extended version. This has the lite version, combined with the sample data, plus some more extensions on it.

So in the end I have 3 version of the same project, small medium and large.

Now what is the best way of doing this. Should I create 3 repositories for this, or can I use just one repository for all the versions.

+1  A: 

If you are keeping the 3 together as examples on how to build other projects, I would keep them in a single git repo. Create the smallest one in the master branch. Then create 2 new branches from master, 1 for each of the other versions. Add the medium changes in the medium branch, and the large changes in the large branch. Master still refers to small.

The advantage of this is when you realize there is some new base functionality that you want in all 3 versions. You just make the changes in master, and then rebase the other 2 branches on master.

Joshua Flanagan
Thank you this sounds ideal for me. But what if I want to use the largest one for a production environment. Could that be possible? I maybe want to have the largest version for the website of the framework. And have people download the lite and medium versions.
Saif Bechan
If all 3 are deliverables, then I would agree with Marcelo that you should differentiate them in your build.
Joshua Flanagan
+2  A: 

Using version control to maintain multiple streams of development is generally a bad idea. It'll require continual merging activity, which is error-prone and burdensome.

You should organise your product stratas without reference to the version control system. Perhaps this could entail a single code base that has the entire extended version, with a build system that supports three different build targets. Each build target includes different subsets of the full product.

Marcelo Cantos
Hello, basically I can understand what your point is. If I understand it correctly you are suggesting to have only the stripped down version on git. And than create any new projects from this. But I do not fully understand what you mean. Are you suggesting to put the other versions not under version control, or do you mean I should use a different system.
Saif Bechan
I said the opposite, actually, "a single code base that has the entire extended version". Perhaps my phrase, "without reference to," confused the issue. What I meant by that was to put everything under version control but design the stratification of your project as if you didn't have it under version control, or, in other words, not to use version control features to manage the stratification of your product.
Marcelo Cantos