Read more about this workflow here
- Two main long-living branches:
main
anddevelop
- Feature branches (or sometimes called topic branches) are used to develop new features for the upcoming or a distant future release. The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into
develop
. - Release branches support preparation of a new production release. The key moment to branch off a new release branch from
develop
is whendevelop
(almost) reflects the desired state of the new release. At least all features that are targeted for the release-to-be-built must be merged in to develop at this point in time. - When the state of the release branch is ready to become a real release, it is merged into
main
and tagged. Finally, the changes made on the release branch need to be merged back intodevelop
, so that future releases also contain these bug fixes. - When a critical bug in a production version must be resolved immediately, a hotfix branch may be branched off from the corresponding tag on the
main
branch that marks the production version.
Food for thought based on blog author's update in March 2020
Read more about this workflow here
- One long-living branch:
main
where steady, production-ready code lives. - Feature branches are short-lived. Deployments are typically done in Pull Request before merge.
- Multiple branches are created for each version
- Features and bug fixes can be selectively cherry-picked onto version branches from
main
branch - When the versions are deprecated, the version branch can be discarded and does not need to be merged back into
main
Git Flow | GitHub Flow | Backport Flow |
---|---|---|
Useful for release based development where a batch of changes needs to go through a set of validations and tests before a new release is published (e.g. packaged software) | Useful for continuous deployments (multiple per week or day) (e.g. for web applications and services) | For software that is deployed to the cloud while also shipped as an installable software, a backport flow could be a great workflow. |
Helpful when compute resources are limited, e.g. long build and test times | More light-weight and simpler than Git Flow | Great for supporting multiple parallel versions at a time |
- Fast parallel development and experimentation
- Further branches divert, the more likely merge conflicts happen
- Merge your feature branches as soon as possible into the main branch
- A powerful technique for allowing this rapid merging is feature flags
- Update your branches with the latest changes from your main branch
- Reviewing your pull requests easier and faster
- Small topic branches will get merged faster
- Push early and often