-
Notifications
You must be signed in to change notification settings - Fork 0
Branching Strategy
The central idea behind a branching strategy is to isolate your work into different types of branches. There are five different branch types in total. The two primary branches are main and develop. There are three types of supporting branches with different intended purposes: feature, release, and hotfix.
Represents the stable, production-ready code. It should always reflect the latest released version of the software. Any code in the main branch should be deployable. To request feedback or help, or when you think your work is ready to merge into the main branch, open a pull request.
Where ongoing development occurs; this is the integration branch for feature development. Developers branch off from develop when working on new features or fixes. Once features are completed, they are merged back into develop for integration testing. Feature branches are created off develop when working on new features or enhancements. This allows developers to work on isolated features without impacting the main development branch. Once the feature is complete, it is merged back into develop.
Release branches are used to prepare the codebase for a new release or version. They are branched off from develop when the development of new features for the next release is frozen. Release branches are primarily for finalizing the release, such as bug fixing, documentation updates, and version number bumping. Once the release is ready, it is merged into both develop (to ensure that any fixes are incorporated into future development) and main (to mark the release as stable). Each time a new release is merged back into main, an additional branch should also be created reflecting the current version of the release, following the format of release-adventure-game-v0.1.0, release-adventure-game-v0.1.1, release-adventure-game-v0.1.2, etc.,
Branches off from develop for developing new features. Create new descriptively-named branches for new work, such as feature-add-enemy-spritesheet. After your work or feature has been reviewed and approved, it can be merged into the main branch.
These are the only branches that will ever branch off of main in order to quickly fix critical issues in the production environment. Allows for immediate fixes without interrupting ongoing development in the develop branch. Once the hotfix is complete, it is merged back into both main (to ensure the fix is deployed to production) and develop (to incorporate the fix into future development).