Day 10 Git Branching Strategies

While developing a product with large pool of the customer, it is a primary goal to deliver new features of the products and new error free update to consumers. In most of the cases, there are prompt releases. To deliver high quality update and prompt releases we need to use version controlling system, i.e. GIT. In GIT, we have a feature call branch which are very useful to achieve the goal.

What is Branch In GIT?

Like tree has branches which are isolated and different than other branches, Branches in GIT servers same purpose. It is use for separation of the code. Such as which code is in testing stage, which is in developing stage, which is in release stage etc.

One of the main advantage of the using branch is, it diverge the mainline and work on the separation of the development without interrupting the main codebase.

Consider the following example of a calculator application.

Here, initially we have created first version of the Calculator application which has features such as Addition, Subtraction, Multiplication, Division etc. But now the requirement from the users it to create new features with having active application. So to fulfill this requirement, we need to use branched. As the new development of the same application can be isolated from the different code. After the testing it can be merged to the main application.

Good Branching Strategies :

Now after learning about branches in GIT, we need to figure out what are the good branching strategies to deliver robust product to the customer. Branching strategies can be vary from a organization to organization.

This a graph of a branches which are mainly used in development lifecycle.

  • Master Branch: - Master branch is consider for active day-to-day development of the software/product. It often called as main, trunk, production branch.

  • Feature Branch: - Feature branches are separate from master branches as it involved in developing new feature of the software. As it should not interrupt the active development it is isolated from main branch. After the testing the new feature and processing it will be merged to master branch.

  • Develop Branch: - The main point of develop branch is to servers as a single point of integration point for ongoing development on the production side.

  • Hotfix Branch: - Any critical issues which has been witnessed by consumer in an release version, we will create a new branch call hotfix with higher priority to solve the issue. The changes which has been made to solve the issue will be updated on master and release branches.

  • Release Branch: - Release branch is full proof version of the software which is tested and ready to use to consumer. The main/master branch is use for active day-to-day development. Release branch has more error proof and well tested code.

As, this is the branching strategy is used by organization according to their needs and style of development.

If you find it interesting and would love to know more about the similar topics, please like my blog and do comment for any suggestion.

Thank you.!