To understand when branching is needed, ask yourself why you are entering first.
There are three main reasons you need to branch out:
You have several versions of your product, and an older version has a defect. In this case, you create a branch with an older version and commit it to the branch. Otherwise, you must include all new code added since release.
You have dozens of programmers working on a project in version 1.0. As the project approaches the release point, you want to stop adding features and fixing bugs. However, this leaves most of your programmers with nothing to do except twist their thumbs, while the two or three programmers responsible for the release work on completing the release. Just not enough work for everyone. In this case, you release Release 1.0 and release your branch. Meanwhile, other developers can continue to work on version 2.0. \
You usually have all the developers working on the release and making minor changes. However, there is a big project that will reorganize the structure of your product. If you have developers working on checking your code on the trunk with other developers, you will not be able to compile your assembly and test the changes. Instead, you enter this special project in your own line of code. In this way, backend restructuring is performed on the side branch, while the rest of the development team can continue to work on the trunk.
In the latter case, the team working with the main line must make sure that their code does not lag behind what is happening in the trunk. They should continue to merge the changes in the trunk onto their side branch. Otherwise, the code differences between the side branch and the trunk become too large to be easily merged.
The question is why Case No. 3 is much more complicated than in the other two cases. The answer is whether the branches depart from each other or converge to each other. In case No. 1 and case No. 2, the branches diverge. In case No. 2, the code for version 1.0 will be different from the code for version 2.0, and the code for version 1.0 will be different from the code for version 3.0. In fact, sometime in the future, the code in the Release 1.0 branch will be irrelevant.
Meanwhile, in case No. 3, the branches converge strongly to each other. This means that you must synchronize them. This requires effort and supervision. It takes a lot of energy to make sure that the branches that ultimately need to be merged in bulk must remain in sync.
This is why most sites now branch out when necessary and do not use the older feature or development branch system. This adds a lot of complexity. Each branch should be managed, and each merger should be carefully checked.
By the way, this is one of the reasons that distributed version control systems are not always better than centralized ones. I saw too many places that Git used, and then the developers worked in their small repository and never talked to each other. A week before the release, we grappled with a dozen patches, and then continue the race to combine all the code into the supplied version.
A centralized repository forces everyone to work on the same set of files. Add to the process of continuous assembly, and you can make sure that there are no surprises. If everyone should work with a centralized repository anyway, the distributed version control system doesn’t really add anything to the mix and can cause problems if you allow developers to live in their small caves.