The key rules of this model are:
- origin/master always reflects a production-ready state.
- origin/develop always reflects a state with the latest delivered development changes for the next release.
- Each time when changes are merged back into master, it's a new production release.
- Other branch types supporting other purposes:
- feature/topic branches: develop new features for the upcoming or a distant future release.
- branch off from develop and merge back to develop once finished.
- typically exist in developer repos only, not in origin.
- exists as long as the feature is in development, eventually merged or discarded.
- release branches: support preparation of a new production release (minor bug fixes and preparing meta-data for a release).
- branch off from develop and merge back to develop & master.
- benefit: develop branch is cleared to receive features for the next big release.
- may exist there for a while, until the release may be rolled out definitely.
- bug fixes may be applied in this branch during the time.
- merge into master and add a tag for final release, and changes in this branch must be merged back into develop branch.
- hotfix branches: resolve a critical bug in production and are meant to prepare for a new production release, albeit unplanned.
- branch off from master and merge back to master & develop.
- bump the version number after branching off!
- when a release branch currently exists, the hotfix changes need to be merged into that release branch.
- feature/topic branches: develop new features for the upcoming or a distant future release.