Why do we need to do software branching ?
Filed Under Benefits, Process, Development, Software | Posted on December 29, 2007
A branch is what happens when your development team needs to work on two distinct copies of a project at the same time. Suppose your development team has just finished and released version 1.0 of your new product, a new product in the market.
Now that you have released your software product, you have a new problem you have never faced before. So far everyone has been working on the same software version. You have had only one “line of development”, but now you have two:
* Development of 2.0. You have all kinds of new features which just didn’t make it into 1.0, and you have customer feedback for new features that will enable you to get a new version out to paying customers.
* Maintenance of 1.0. Now that real customers are using your product, they will probably find at least one bug your testing didn’t catch. For bug fixes or other minor improvements requested by customers, it is quite possible that you will need to release a version 1.0.1.
It is important for these two lines of development to remain distinct. If you release a version 1.0.1, you don’t want it to contain a half-completed implementation of a 2.0 feature. So what you need here is two distinct source trees so your team can work on both lines of development without interfering with each other, otherwise it will get very complex for your team to manage these 2 separate versions.
To address this very type of problem, source control tools support a feature which is usually called “branching”. When you use the branching feature of your source control tool, it creates a fork in the path of your development progress. You now have two trees, but the source control has not forgotten the fact that these two trees used to be one. For this reason, the SCM tool can help make it easier to take code changes from one fork and apply those changes to the other. We call this operation “merging branches”.
If you do not use a branching strategy effectively, it will soon get very complex and very messy. At the same time, branching needs to be done only when the situation demands it, and is absolutely not necessary in every case.
Leave a Reply