Continuous Integration
Continuous Delivery
Git-Flow
DevOps
Software Development

Continuous integration and continuous delivery with git-flow

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Git-flow can work with CI and CD, but only if each branch type has a clear delivery meaning. Without branch-specific automation, branch names such as develop, release/*, and hotfix/* are just labels with no operational value.

The real challenge is not whether git-flow and CI/CD are compatible. They are. The challenge is whether the branching model still matches your deployment frequency, release process, and team size.

Map Branch Types to Delivery Intent

Git-flow usually defines these branches:

  • 'main for production history'
  • 'develop for the integrated next release'
  • 'feature/* for isolated work'
  • 'release/* for stabilization'
  • 'hotfix/* for urgent production fixes'

CI/CD becomes predictable only when each branch type answers these questions:

  • what tests run
  • which environment may be deployed
  • who may merge
  • what approvals are required

If those answers are not explicit, the branching model is not actually integrated with delivery.

A Practical Pipeline Mapping

A common mapping looks like this:

yaml
1feature/*:
2  - lint
3  - unit_tests
4
5develop:
6  - lint
7  - unit_tests
8  - integration_tests
9  - deploy_dev
10
11release/*:
12  - full_test_suite
13  - security_scan
14  - deploy_staging
15
16main:
17  - full_test_suite
18  - deploy_production

This gives fast feedback on feature branches and progressively stronger gates as code gets closer to production.

Release and Hotfix Automation

Git-flow is most useful when release and hotfix branches correspond to operational workflows, not just manual habits.

A release branch flow often looks like this:

bash
1git checkout develop
2git checkout -b release/2.4.0
3# stabilize, test, update notes
4git checkout main
5git merge --no-ff release/2.4.0
6git tag v2.4.0
7git checkout develop
8git merge --no-ff release/2.4.0

A hotfix branch should start from main, then merge back to both main and develop.

bash
1git checkout main
2git checkout -b hotfix/2.4.1
3# patch and test
4git checkout main
5git merge --no-ff hotfix/2.4.1
6git tag v2.4.1
7git checkout develop
8git merge --no-ff hotfix/2.4.1

If you skip the merge-back into develop, the same bug often returns later when develop is released.

CI/CD Should Promote Immutable Artifacts

A strong delivery pipeline builds once and promotes the same artifact through environments.

yaml
1build:
2  output: app-image:sha-abc123
3
4deploy_staging:
5  image: app-image:sha-abc123
6
7deploy_production:
8  image: app-image:sha-abc123

Rebuilding per environment weakens the whole point of CI/CD because the staging artifact is no longer the same thing that reaches production.

When Git-Flow Is a Good Fit

Git-flow tends to fit teams that:

  • release in explicit versions rather than continuously
  • need short stabilization windows
  • manage hotfixes separately from ongoing feature work
  • have compliance or release-management checkpoints

If the team deploys many times per day, release branches stay open too long, or develop becomes a permanent integration bottleneck, git-flow may be more process than value.

Common Pitfalls

A common mistake is adopting git-flow naming without adopting branch-specific pipeline behavior. That creates complexity without control.

Another issue is running the full production-grade pipeline on every feature branch, which slows feedback loops unnecessarily.

Developers also sometimes forget hotfix merge-back into develop, which defeats the whole model’s consistency.

Finally, teams keep git-flow long after their release process has changed. Branch strategy should serve delivery metrics, not nostalgia.

Summary

  • Git-flow can work well with CI and CD when each branch type has a clear delivery role.
  • Map tests, deployments, and approvals explicitly to branch categories.
  • Automate release and hotfix flows, including merge-back behavior.
  • Promote immutable build artifacts through environments.
  • Reevaluate git-flow if its branch structure no longer matches how the team actually ships software.

Course illustration
Course illustration

All Rights Reserved.