Git Branch Workflows
Example of DevOps Git Branch Structure

Senior Digital Engineer at Patagonia & Founder of SFCC DevOps.
Here is an example of a workflow used on SFCC teams that consist of a few common types of branches, each with different roles:
| BRANCH | EXAMPLE | ROLE |
develop | - | Integration Branch before Merging into main |
main | - | Production Ready Code |
fix/* | fix/123-broken-form | Based on latest develop and Issue Specific |
feature/* | feature/123-mobile-header | Based on latest develop and Feature Specific |
release/* | release/v1.2.3 | Based on latest develop and Release Specific |
hotfix/* | hotfix/mobile-menu | Based on latest main and Hotfix Specific |
Here is an example of how code flows through this repository:

Creating New Branches
We suggest using naming conventions for creating and managing branches.
Fix
Each Bug Fix reported should have its own
fix/*branch. The branch name should be formattedfix/###-issue-namewhere###is the Issue Number, andissue-nameis a 1-3 word summary of the issue.
Checkout latest
developbranchPull down the latest changes via
git pullCreate a new branch with the structure
fix/*, e.g.fix/123-broken-formWhen you are ready to submit your code, submit a new Pull Request that merges your code into
developTag your new Pull Request with
Ready for Code Review
Feature
Each New Feature should reside in its own
feature/branch. The branch name should be formattedfeature/###-feature-namewhere###is the Issue Number, andfeature-nameis a 1-3 word summary of the feature.
Checkout latest
developbranchPull down the latest changes via
git pullCreate a new branch with the structure
feature/*, e.g.feature/123-mobile-headerWhen you are ready to submit your code, submit a new Pull Request that merges your code into
developTag your new Pull Request with
Ready for Code Review
Release
Each New Release should reside in its own
release/branch. The branch name should be formattedrelease/v#.#.#wherev#.#.#is the next version number to be deployed. Our version numbers use Semantic Versioning, e.g. MAJOR.MINOR.PATCH.
NOTE: New Release Branches should only be created by the Release Manager.
Checkout latest
developbranchPull down the latest changes via
git pullCreate a new branch with the structure
release/*, e.g.release/v1.2.3When you are ready to submit your code, submit a new Pull Request that merges your code into
mainTag your new Pull Request with
Ready for Code Review
Hotfix
Emergency Hotfixes should reside in their own
hotfix/branch. The branch name should be formattedhotfix/hotfix-namewherehotfix-nameis a 1-3 word summary of the new hotfix.
NOTE: New Hotfix Branches should only be created by the Release Manager.
Checkout latest
mainbranchPull down the latest changes via
git pullCreate a new branch with the structure
hotfix/*, e.g.hotfix/mobile-menuWhen you are ready to submit your code, submit a new Pull Request that merges your code into
mainTag your new Pull Request with
Ready for Code Review
Continuous Integration
We have three Environments set up for every project, each set up with Continuous Integration and independent URLs for testing.
| ENVIRONMENT | TAG | BRANCH | SOURCE BRANCH |
vx.x.x | - | main | |
staging-* | - | release/* or hotfix/* | |
| - | develop | develop |
[X] Production is deployed when a Tagged Branch matching
vx.x.xis created frommain[X] Staging is deployed when a Tagged Branch matching
staging-*is created from arelease/*orhotfix/*branch[X] Development is deployed with any Pull Request that is merged into the
developbranch




