4

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?

  • I've already found an issue with just tagging develop: hotfixes. Hmm, still curious about other pitfalls. – Shoe Jan 14 '16 at 5:41
  • gitflow also assumes there is an integration phase in the release-* branches, and that work might evolve for some until it becomes a stable release while the develop branch has progress further in the mean time. Simple tagging wouldn’t allow you to capture that. – Hugo Ferreira Jan 15 '16 at 12:46
  • @HugoFerreira How so? If you were to simply remove master from the gitflow model, then the release branches would still be there and develop would still continue. And once release is joined back to develop, it can be tagged as the new version. – Shoe Jan 15 '16 at 13:02
  • well, the tag would have to be in the release-* branch (which are not meant to be long lived branches) to accurately point to the actually release code, and not in the develop branch because you might have added new commits to develop 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 to develop. – Hugo Ferreira Jan 15 '16 at 16:00
  • @HugoFerreira Oh I see. – Shoe Jan 15 '16 at 21:28
5

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.