← SnapRecaps

3 Git Workflows Every Developer Should Know (And When to Use Each)

► 140,689 views ⏲ 31:32 Watch on YouTube ↗

Summary

The video argues GitFlow is outdated for modern DevOps, explaining why Trunk-Based Development has become the best practice, but only with strong CI/CD, feature flags, and team discipline.

Executive Summary

The video explores how Git workflows have evolved from GitFlow’s complex, multi-branch structure toward simpler continuous-delivery models like GitHub Flow and Trunk-Based Development, emphasizing that there is no one-size-fits-all solution. GitFlow still suits versioned software and regulated industries, but its heavy overhead makes it poor for modern continuous deployment, while GitHub Flow offers simplicity yet depends on strong team discipline. Trunk-Based Development is presented as the current industry best practice for high-performing DevOps teams, enabling rapid integration through short-lived branches, feature flags, and continuous automated testing. However, it demands a cultural shift, bulletproof CI/CD, and robust test coverage to avoid breaking production. Ultimately, the real takeaway is that high-performing teams must invest in the supporting ecosystem—automated testing, feature flags, CI/CD, and clear documentation—rather than focusing only on choosing the "right" branching model.

Key Points

  • ▶ 1:51 Git's flexibility gives teams freedom but harms consistency, so conventions were created to make collaboration, code review, and deployments more predictable.
  • ▶ 2:35 The right workflow depends on what you're building and how you deploy—there is no one-size-fits-all approach.
  • ▶ 2:45 Mobile apps need to support multiple versions in the wild, while web apps can deploy continuously many times a day, creating completely different workflow needs.
  • ▶ 3:25 Git Flow, introduced by Vincent Driessen in 2010, relies on multiple long-lived branches (main, develop, feature, release, hotfix) to manage different stages of development.
  • ▶ 5:42 Git Flow still makes sense for versioned software (e.g., desktop/mobile apps), supporting multiple versions simultaneously, large teams needing structure, and regulated industries requiring traceability.
  • ▶ 7:08 It is now considered bad practice for modern continuous delivery because branch management adds heavy overhead, causes merge conflicts, and even its own creator later recommended simpler workflows for web apps.
  • ▶ 8:53 GitHub Flow is a much simpler alternative to GitFlow: create a branch from main, make changes, open a pull request, review and merge, then deploy immediately.
  • ▶ 10:11 It works best for continuously deployed web apps, small fast-moving teams, and teams with strong automated testing/CI/CD, but it does not support multiple released versions and requires strict discipline.
  • ▶ 12:23 The "ugly truth" is that GitHub Flow assumes your team already has good habits; if pull requests and testing are treated casually, bad code can go straight to production.
  • ▶ 14:34 Trunk-Based Development is presented as the speaker's favorite and the current industry best practice, especially for high-performing DevOps teams.
  • ▶ 15:08 The practice allows either committing straight to the main branch or using temporary branches that last about half a day, but the core principle is continuous integration.
  • ▶ 15:20 Trunk-Based Development directly supports the DevOps CI/CD philosophy, making it the natural Git workflow for continuous integration and deployment.
  • ▶ 15:59 Trunk-Based Development uses feature flags as switches to hide incomplete code from users—the code is in production, but the feature stays disabled until ready.
  • ▶ 16:34 Every small commit to main triggers automated tests that catch issues before deployment, delivering fast feedback and preventing unnoticed breakage.
  • ▶ 16:45 Teams work all week with small, continuous commits, then flip the flag on Friday to release—resulting in zero merge conflicts and immediate fixes.
  • ▶ 17:58 Bulletproof automated testing is a non-negotiable requirement for TBD, since continuous production deploys demand confidence that code is not buggy or insecure.

  • ▶ 18:35 TBD is best for teams prioritizing rapid integration and faster deployment; DORA research shows it improves deployment frequency and recovery times.

  • ▶ 19:10 TBD shines for SaaS products with a single production version that are continuously updated.

  • ▶ 19:16 The speaker shifts to a critical tone, emphasizing that trunk-based development has a "flip side" and real challenges that must be considered.
  • ▶ 19:24 The first challenge begins to be introduced, though the explanation is cut off at this point, signaling an upcoming list of difficulties.
  • ▶ 19:27 Inexperienced developers can accidentally break production when committing directly to main, especially if test coverage is sparse.
  • ▶ 19:52 TBD requires proper systems and guardrails—not reliance on individual discipline—and weak test coverage can lead to chaos if not addressed.
  • ▶ 20:35 Adopting TBD demands a cultural shift: teams must master small commits, feature flags, and continuous integration.
  • ▶ 20:54 TBD requires a fundamental mindset change, not just a technical one.
  • ▶ 20:56 The "ugly truth" is that TBD feels reckless because it forces developers to build the automated testing they should have had all along, exposing weak test coverage.
  • ▶ 21:09 Like removing training wheels, the transition is scary, but it becomes much faster and more efficient than the old cautious approach.
  • ▶ 21:15 Trunk-Based Development becomes faster once developers learn it properly, despite an initial learning curve.
  • ▶ 21:21 TBD aligns naturally with DevOps because it relies on CI/CD pipelines, automated tests, and a shared culture of quality.
  • ▶ 21:35 Practitioners who have mastered TBD in real projects are strongly convinced it is the best approach and would never switch back.
  • ▶ 21:47 Once Trunk-Based Development really works in practice, it becomes convincing; viewers are invited to share their own experiences in the comments to help others learn.
  • ▶ 21:57 Practitioners of TBD often hold that high-performing teams can only use Trunk-Based Development—there is "no other option" at the highest level.
  • ▶ 22:06 Once you get TBD right, you won't look for alternatives.
  • ▶ 22:52 The shift from GitFlow-style versioned releases to continuous delivery (with companies like Amazon and Netflix deploying multiple times daily) made GitFlow's long-lived branches and merging overhead too slow, leading to simpler models like GitHub Flow.
  • ▶ 25:13 Many real-world teams use hybrid approaches—e.g., trunk-based development with release branches for stability, or requiring pull requests only for external contributors—to balance speed with safety.
  • ▶ 27:16 The real takeaway: high-performing teams must invest in the supporting ecosystem—strong testing, CI/CD, feature flags, and a DevOps culture—because workflow evolution depends on those underlying practices, not just the branching model.
  • ▶ 27:47 Automate everything possible—tests, CI/CD, linting, and security scanning—regardless of which Git workflow you choose.
  • ▶ 28:15 Document your branching strategy, commit conventions, and review expectations to ensure consistency across the team.
  • ▶ 29:56 Optimize for speed of feedback: simpler workflows that move code to production faster help the team learn and improve, and evolve your workflow as your team grows.

Video Sections

  • ▶ 0:00 Introduction and Why Workflows Exist (0:00 - 3:09) - - Intro, subscription call, and why different Git workflows exist.
  • ▶ 3:09 Git Flow: The Former Standard (3:09 - 8:53) - - Covers Git Flow, a hotfix example, when it makes sense, and why it's now considered bad practice.
  • ▶ 8:53 GitHub Flow: Simpler Alternative and Sponsor Break (8:53 - 14:34) - - Covers GitHub Flow scenarios, use cases, challenges, the "ugly truth," and the MongoDB sponsor segment.
  • ▶ 14:34 Trunk-Based Development: The Modern Approach (14:34 - 22:12) - - Explains trunk-based development, CI/CD, feature flags, impact, when it shines, and its challenges.
  • ▶ 22:12 Workflow Evolution and Common Hybrids (22:12 - 27:39) - - Discusses why workflows evolved, real-world reflection, hybrid adaptations, and trunk-based development's popularity.
  • ▶ 27:39 Practical Tips and Closing Advice (27:39 - 31:34) - - Provides practical Git workflow tips, final advice, and the closing call to action.

Exact Transcript

Load the full timestamped transcript on demand and click any time to jump in the video.