Glossary · Automation software engineering and architecture
Branch (version control)
Also known as: Branch, Code branch
German: Branch
In version control, a branch is an independent line of development that diverges from a common point in the history of a repository, so changes can be made in isolation and later merged back or kept separate, for example for a release or a customer variant.
- Software engineering
In one sentence
In version control, a branch is an independent line of development that can later be merged back into the main line.
Example
The team creates a release branch for machine software version 3.2; bug fixes are made there and merged into the main branch, while new features continue on main.
How it applies
- Engineering: Branches separate work in progress from stable code. Common strategies are trunk-based development with short-lived branches, or release branches that receive only fixes.
- Maintenance: Long-lived branches for customer variants or old releases drift apart, so fixes must be merged or re-applied to several branches. Keep their number small and document which fixes went where.
- Documentation: Release notes, manuals and the Configuration baseline should refer to tagged commits, not to branch names, because branches move. Documentation sources kept in version control can follow the same branching model as the software, so a manual revision matches its software release.
Branch vs. variant
A branch is a version control mechanism; a product variant is a product management decision. Managing variants purely as branches tends to create divergent code. Parameters, Feature flag switches or configuration are often a better way to handle variants.
Not to be confused with DITA branch filtering, a DITA 1.3 feature for filtering map branches.