.NET  

Git Branching Strategy & Release Workflow

Introduction

This article outlines a robust Git branching strategy and release workflow tailored for .NET teams working with Azure DevOps. It includes clear naming conventions, branching rules, versioning practices, and release management best practices to ensure smooth development, QA, and deployment cycles.

1. Git Branch Types and Naming Conventions

Use consistent, purpose-driven branch names to make collaboration and automation easy.

BranchPurposeExample Name
mainStable, production-ready codemain
developOngoing development integration branchdevelop
feature/*New features or enhancementsfeature/user-login
bugfix/*Bug fixes during developmentbugfix/fix-api-timeout
release/*Pre-release stabilizationrelease/2.3.0
hotfix/*Urgent production fixeshotfix/critical-500-error


2. Branching Decision Guide

To avoid ambiguity, use this quick reference to decide which branch to create from where:

If You Are...Then Create Branch From
Building a new featureCreate from develop → feature/*
Fixing a development bugCreate from develop → bugfix/*
Preparing a releaseCreate from develop → release/*
Fixing a critical production bugCreate from main → hotfix/*

3. Release Branch Workflow

Follow these steps when you're preparing a release:

git checkout develop
git pull
git checkout -b release/2.3.0
git push -u origin release/2.3.0

2. Stabilize the release (bugfixes, config, version bump)

Only allow bug fixes, version updates, or release-specific config. Enforce PR policies like build success, minimum 2 reviewers, and no direct pushes.

3. Tag the release for traceability

git tag -a v2.3.0 -m "Release 2.3.0"
git push origin v2.3.0

4. Merge into main and develop

git checkout main
git merge release/2.3.0
git push

git checkout develop
git merge release/2.3.0
git push

5. (Optional) Delete the release branch

git branch -d release/2.3.0

git push origin --delete release/2.3.0