I am working on a project wherein we are to use SVN as a source repository and we need to identify a branching strategy. I am aware of branch by release & branch by feature strategies to certain extent but I am no expert and I am not sure which one or if at all either is more suitable to our requirement.
We have 2 environments, Production and Pre-Production. Once a feature is released it is first deployed in pre-production and tested rigorously before moving to production. So production environment is typically a couple of versions behind latest code version. We might receive bugs on both Production and Pre-production simultaneously. If a bug is reported on production, we need to deliver the fix on top of its current version while if on pre-production it needs to be delivered on that particular release latest version.
Has anyone had similar requirement and experience of handling such a situation. It will be good to understand the candidate solutions with pros and cons of each.
Best Answer
Seems like we use similar staging/pre-production routine in our company.
Our branching strategy is (we use Git):
Project managers decide which fixes/features must go into next release, then we merge all selected branches into master and roll out the next release semi-automatically with Maven release plugin. We often do rebases to keep repository's history as linear as possible.
So, in short, we do both branch-by-release (because we support different versions of our products) and branch-by-feature/bugfix. There is no contradiction.
branch-by-release
Pros:
Cons: none I see
branch-by-feature
Pros:
Cons:
SVN
Since you mentioned it... SVN will not work for what I described. I have just a little experience with it, and it was pain. Speaking of branching, SVN branches are heavy and slow, and you cannot commit offline. I'm not a hater, it's just lacks many features I need. I recommend Git, but you might also look at Mercurial or other DVCS's.