Version control¶
Branching model¶
We follow a loose version of the Git flow branching model.
- Changes are developed in feature branches and submitted as pull requests via Github
- Feature branches should always be based on:
develop - Release branches should always be based on:
develop - Release branches should be merged via PR into
main, followed by PR to mergemainintodevelop - Create a new branch if the branch for that ticket has been merged.
See below for merging guidance
Naming branches¶
- Use only alphanumeric characters and hyphens where possible and avoid special characters.
- Branch names for ticketed new features should follow:
feature/JIRA-TICKET-NUMBER-with-short-description - Branch names for ticketed bug fixes should follow:
fix/JIRA-TICKET-NUMBER-with-short-description - Branch names for releases should follow:
release/major.minor.patch - Branch names for housekeeping tasks or other unticketed work should follow:
chore/short-description - For example:
feature/UN-123-extra-squigglesfix/DF-999-image-view-errorrelease/1.0.0chore/update-documentation
Naming pull requests¶
- Pull requests for features and bug fixes should be titled:
JIRA-TICKET-NUMBER: short-description - Pull requests for release branches should be titled:
Release X.X.X into main - Pull requests for housekeeping tasks or other unticketed work should be titled:
CHORE: short-description - For example:
UN-123: Add extra squigglesDF-999: Fix image view errorRelease 1.0.0 into mainCHORE: Update documentation
Merging branches¶
NOTE: Where possible, a feature branch should be kept up-to-date with develop by regularly merging develop into the feature branch. This will help to prevent conflicts when merging the feature branch back into develop, and ensure there are no inconsistencies.
- When merging a feature branch into
develop, use theSquash and mergeoption to keep the commit history clean - When merging a release branch into
main, use theMerge commitoption to keep the commit history continuous fromdevelop - When merging
mainback intodevelop(after merging a release branch intomain), use theMerge commitoption to prevent any conflicts when merging future releases intomainto keep the history in sync - This should be named
Release X.X.X main into developto make it clear what the merge is for