I am studying Git and from what I saw about branches I basically identified two main situations in which branches are useful:
When we have a stable version of the code in the master branch and want to add a new functionality, we then create a branch to develop the functionality without the danger of breaking what we already have in the master branch. / li>When we have a stable version of the code in the master branch and we need to fix a bug found, we created a branch to work on this bug and we do not risk damaging the stable code
These two uses seem to be very common, because I have also seen in many articles and videos they are cited. The issue is that I've also heard that more experienced Git users recommend making lots of use of branches. I once saw an answer in Stack Overflow in English that said that it's best to start branching earlier and always use branches.
It turns out that in these two cases that I have identified which branches would be useful, the utility comes from the fact that there is a stable code that is not interesting to mess around with and want to have the freedom to work on something without spoiling this code. I can not see how that before we have a stable branching code can be useful.
That way, when branches are really useful in Git and why does this recommendation start branching from the beginning and always use it?