🔄

Git Flow vs Continuous Integration Analysis

Apr 2, 2025

Git Flow vs Continuous Integration

Introduction

  • Speaker: Dave Farley, Continuous Delivery enthusiast
  • Overview: Discussion on Git Flow and its compatibility with Continuous Integration (CI) and Continuous Delivery (CD)
  • Acknowledgment of sponsors: Harness, Equal Experts, Octopus, Spec Flow

What is Git Flow?

  • Invented in 2010 by Vincent Driessen.
  • Not originally designed with CI/CD in mind.
  • Structure:
    • Two main branches: develop and master.
    • Additional branches: feature branches, release branches, hotfix branches.
  • Git Flow adds complexity to version control.

Continuous Integration (CI) Fundamentals

  • CI's goal: Maintain a shared, accurate view of the system.
  • Frequent evaluations of code changes (multiple times a day).
  • Quote: "What if the engineers didn't hold on to modules for more than a moment?"
  • Emphasis on evaluating changes directly in the context of production.

Issues with Git Flow

  • Git Flow creates ambiguity in change management:
    • The develop branch may not reflect the definitive, production-ready state.
    • Hotfixes not merged back into develop can create discrepancies.
    • Keeping develop and master branches in sync can become cumbersome.
  • Feature Branches:
    • Delaying feedback until features are deemed finished is counterproductive.
    • Risks of wasted work due to late feedback.

Alternative Strategies

  • Proposal to merge changes directly into master instead of develop.
  • Continuous integration should happen often to maintain a clear picture of safety and quality.
  • Suggested elimination of the develop and hotfix branches.
  • Trunk-based development:
    • Frequent commits to the master branch.
    • Trigger CI pipelines upon push to master.

Recent Developments in Git Flow

  • Brian Finster's outreach to Vincent Driessen resulted in updates to Git Flow’s description.
  • Git Flow is labeled a "legacy" workflow.
  • Encouragement to adopt simpler workflows like GitHub Flow for teams practicing CI/CD.

Critique of GitHub Flow

  • GitHub Flow still relies on feature branches, which can delay feedback.
  • Lack of mention of CI/testing in GitHub Flow documentation raises concerns.

Conclusion

  • Both Git Flow and GitHub Flow can slow down the feedback cycle and limit integration frequency.
  • Continuous Integration encourages more incremental development and timely feedback.
  • Continuous Integration is more effective in delivering safe, production-ready software.
  • A shift in mindset is necessary for developers to adopt CI practices.