Reading the gitflow model, it seems to me that the master branch is there only to provide a branch where to store stable versions. What does that add to just tagging develop
with the stable versions?
1 Answer
It is similar to the question "Why do we say 'today', instead of 'the day that started the last time the clock went from 23:59 to 00:00'?"
Having the concept of "latest stable" codified in a branch rather than something you have to search for simplifies things.
Whenever you need the latest stable version of the code, you check out the master branch. If you only use tags to mark stable versions, you'd need to first find out what the latest version was so you can check out the correct tag.
You can also feed it into your production line; any time a commit is made to the master branch, that triggers a build and deployment of your product.
You could do all those things without a master-branch; without any branches or tags at all. But it is easier with them, and the whole point of git-flow is to make things easier. Easier to know what you should do, what others do and to communicate about those doings.
develop
: hotfixes. Hmm, still curious about other pitfalls.gitflow
also assumes there is an integration phase in therelease-*
branches, and that work might evolve for some until it becomes a stable release while thedevelop
branch has progress further in the mean time. Simple tagging wouldn’t allow you to capture that.release-*
branch (which are not meant to be long lived branches) to accurately point to the actually release code, and not in thedevelop
branch because you might have added new commits todevelop
in the meantime. The image in the link is a bit erroneous because it doesn't illustrate that, while you're doing the release, other devs might be committing todevelop
.