You almost answered your question in one of your comments:
the purpose of master is to be a replica of a production ready stable code
Let me elaborate on that:
(1) That statement is correct. master
is production-ready. According to git-flow
every commit (being a merge from a release
or hotfix
branch) leads to a new release.
(2) If you merge develop
directly onto master
you might end up with instabilities. That's what we create a release
branch for. We use the latest version of develop
but test them, make some bug fixes, adjust configurations etc.
Only when everything is fine we actually merge onto master
and therefore deploy to our users.
A final - but very important - note here:
git-flow
is just one of many ways to organise your code. It's not a this is the one and only solution for everyone and everything
. It's just a suggestions, a framework. Adjust it to your needs or use a completely different framework / idea if it does not work for you. I rarely used git-flow
in the past 15 years exactly the way it's documented. We always made some adjustments.
One of them btw being very closely related to your question: We would deploy from release
and only if that deployment works and reached our clients (Apple's review process, I tell you!) we would merge to master
and tag that release.