When to branch
Create a baseline branch when you need to make separate changes to the baseline code. Baseline branches are most commonly created at the feature freeze and code freeze development milestones, but they can also be created for other reasons, such as a beta release or to separate a group of developers working on a large feature. To keep branches in sync, changes can be promoted into common ancestor branches and changes from ancestors can be rebased into the new branches.
Feature freeze
The feature freeze milestone, which is when feature development for the next release is complete, is an ideal time to create a child branch from the baseline. Branching at this point lets the development team focus on different responsibilities. Developers working on issue fixes for the current release can make changes in the feature freeze branch, while developers working on new features for the next release can continue working in the baseline branch.
After issues are fixed in the feature freeze branch, promote the changes to the baseline branch so the next product release includes the issue fixes. Make sure the feature freeze branch is read-only or create a snapshot branch to ensure developers do not inadvertently make any changes.
Code freeze
The code freeze milestone, which is when the product is ready for release, is the next time to create a branch. Creating a code freeze branch from the feature freeze branch captures the code to be released. Developers should only be allowed to make critical bug fixes in the code freeze branch. If a critical bug is found, it can be fixed in the code freeze branch and promoted into both the feature freeze and baseline branches. Make the code freeze branch read-only after the product is released to ensure the released code is captured. This branch can be useful later if it is necessary to rebuild a previous release.
Feature branches
Branches can also be created for a specific feature that affects a large amount of code. Creating a feature branch allows developers to work on the feature without their changes affecting other developers. When feature development is complete, rebase the baseline branch code into the feature branch so the new feature can be tested along with any new or changed baseline branch code. After testing is complete, promote the feature branch changes to the baseline branch so they are included in the next release.