Exploring branching strategies
A branch is a version of your code stored in an SCM system. When using SCM with Git, choosing the best branching strategy to adopt for your team is crucial because it helps you have a reliable code base and fast delivery.
With SCM, if you're not using branching, you always have a single version of your code (master
branch) and you always commit to this branch:
This "one flow" way of work is not recommended because it cannot guarantee that the master
branch is stable, especially if you have more than one developer working on the same code.
There are different branching workflows (strategies) that you can adopt for your team, and the recommendation that normally I suggest is to start simple. With Git, there are three main branching strategies that you can adopt:
- GitHub Flow
- GitLab Flow
- Git Flow
In the following sections, we'll explore each of these strategies...