Module 8 Lesson 4: GitHub Flow
·DevOps

Module 8 Lesson 4: GitHub Flow

Simple, fast, and agile. Learn GitHub Flow—the preferred workflow for modern web applications and teams that practice continuous delivery.

Module 8 Lesson 4: GitHub Flow

Git Flow (from the previous lesson) is powerful, but many modern web teams found it too complicated. They didn't want a develop branch and a main branch. They wanted something faster.

GitHub Flow is a lightweight, branch-based workflow that is designed for teams that deploy to production frequently (often multiple times per day).


1. The Six Simple Rules

GitHub Flow consists of just six steps:

  1. Anything in the main branch is deployable. (It must always pass all tests).
  2. To work on something new, create a descriptively named branch off of main (e.g., feature/new-login).
  3. Commit to that branch locally and regularly push your work to the same named branch on the server.
  4. When you need feedback or help, or you think the branch is ready for merging, open a Pull Request.
  5. After someone else has reviewed and signed off on the feature, you can merge it into main.
  6. Once it is merged and pushed to main, it is immediately deployed to production.

2. GitHub Flow vs. Git Flow

FeatureGit FlowGitHub Flow
Main BranchOnly contains releasesContains latest "Live" code
Dev BranchYes (develop)No
ComplexityHigh (5+ branch types)Low (Only 2 branch types)
SpeedSlower (Release cycles)Fast (Continuous Delivery)
graph TD
    Main["main (Always Live)"] -- "Branch" --> Feature["feature/X"]
    Feature -- "Commit" --> Feature
    Feature -- "Review / PR" --> Merge["Merge to main"]
    Merge --> Deploy["Auto-Deploy to Server"]
    Deploy --> Main

3. Why it works for the Web

In web development, you don't usually need to support multiple versions (like a mobile app or a desktop OS). There is only one "Version"—the one currently running on the server. GitHub Flow is perfectly optimized for this "Single Version" reality.


Lesson Exercise

Goal: Compare the Complexity.

  1. Imagine you are a solo developer building a blog.
  2. You need to change the font size of the titles.
  3. Write down the branches you would need to create in Git Flow. (develop, then feature/font, then maybe a release/font?).
  4. Now, write down the branches you would need in GitHub Flow. (Just feature/font).
  5. Which one feels more natural for a quick change?

Observation: You'll see that GitHub Flow removes the "Bureaucracy" of Git. It trusts your automated tests and your peer reviews to keep main stable.


Summary

In this lesson, we established:

  • GitHub Flow is the standard for Continuous Delivery.
  • It replaces the develop branch with a "Deployable main" rule.
  • It is significantly faster and easier to manage than Git Flow.
  • It relies heavily on Pull Requests and Automated Testing (CI).

Next Lesson: Some teams think even branches are too slow. Welcome to the "Final Level" of Git strategies: Lesson 5: Trunk-Based Development.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn