Saif Bechan
Saif Bechan

Reputation: 17121

Best way of creating lite and extended version of Git project

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.

Upvotes: 2

Views: 223

Answers (2)

Marcelo Cantos
Marcelo Cantos

Reputation: 185852

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.

Upvotes: 3

Joshua Flanagan
Joshua Flanagan

Reputation: 8557

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.

Upvotes: 2

Related Questions