Archives

MY APPROACH

The right solution, not the biggest solution.

You don't need to know whether your problem needs an API, an automation workflow, a dashboard or a custom application.

Tell me the problem. I'll help figure out a practical way to solve it.

Git Flow vs GitHub Flow – Explained Step by Step

When teams adopt Git, the first big question is: which workflow should we use? Pick the wrong one, and you’ll drown in merge conflicts or slow releases. Pick the right one, and collaboration feels natural. Let’s break down Git Flow and GitHub Flow, step by step, with practical insights.

Git Flow – Structured and Release-Oriented

Git Flow was introduced by Vincent Driessen and is built for projects with scheduled releases. It uses multiple long-lived branches:

  • main → production-ready code
  • develop → integration branch for features
  • feature/* → new features
  • release/* → prep for production release
  • hotfix/* → urgent fixes

Typical Workflow

  1. Start a feature:
    git checkout -b feature/login develop
    
  2. Commit and push changes.
  3. Merge back into develop.
  4. When ready, create a release branch:
    git checkout -b release/1.0 develop
    
  5. Merge into main and tag the release.
  6. Hotfixes go directly from main into develop.

Pros:

  • Clear separation of concerns.
  • Strong release management.
  • Works well for large teams.

Cons:

  • Heavy branching overhead.
  • Slower for continuous deployment.

GitHub Flow – Lightweight and Continuous

GitHub Flow is simpler. It assumes continuous delivery and short-lived branches. The rules are straightforward:

  • main is always deployable.
  • Create a branch for each change.
  • Open a pull request (PR).
  • Get a review.
  • Merge into main and deploy.

Typical Workflow

  1. Start a branch:
    git checkout -b feature/login
    
  2. Commit and push changes.
  3. Open a PR for review.
  4. Merge into main once approved.
  5. Deploy immediately.

Pros:

  • Simple and fast.
  • Perfect for small teams and open-source projects.
  • Easy CI/CD integration.

Cons:

  • No staging branch.
  • Risky for large, complex projects.

Real-World Gotchas

  • Git Flow: Teams often forget to merge hotfixes back into develop, causing regressions.
  • GitHub Flow: If main isn’t protected with CI checks, broken code can slip into production.
  • Both: Naming branches poorly (fix-stuff) makes history unreadable. Use descriptive names.

Which One Should You Use?

  • Enterprise projects with quarterly releases → Git Flow.
  • Startups or open-source with daily deployments → GitHub Flow.
  • Hybrid teams → Some adopt GitHub Flow but add a staging branch for safety.

Visual Comparison

To make the difference clearer, here’s a side-by-side look at Git Flow and GitHub Flow branch structures. Notice how Git Flow relies on multiple long-lived branches, while GitHub Flow keeps things lightweight with short-lived feature branches and pull requests.

flowchart LR
    subgraph GitFlow
        A[main] -->|release| B[develop]
        B --> C[feature/*]
        B --> D[release/*]
        A --> E[hotfix/*]
    end

    subgraph GitHubFlow
        F[main] --> G[feature/*]
        G --> H[Pull Request]
        H --> F
    end

Caption: Git Flow vs GitHub Flow branching structures – a visual comparison of how teams organize code.

Step-by-Step Visual Walkthrough

Finally, here’s a step-by-step visual walkthrough of both workflows. The numbered arrows show the exact sequence of actions, so you can follow the process like a tutorial.

flowchart LR
    subgraph GitFlow
        A[main] -->|1: start release| B[develop]
        B -->|2: create feature| C[feature/*]
        C -->|3: merge back| B
        B -->|4: prepare release| D[release/*]
        D -->|5: merge release| A
        A -->|6: hotfix| E[hotfix/*]
        E -->|7: merge hotfix| B
    end

    subgraph GitHubFlow
        F[main] -->|1: create branch| G[feature/*]
        G -->|2: commit & push| H[Pull Request]
        H -->|3: review & approve| F
        F -->|4: deploy| I[Production]
    end

Caption: Step-by-step Git Flow vs GitHub Flow – numbered sequence of actions for feature development, review, and release.

Wrap-Up

Git Flow and GitHub Flow aren’t rivals—they’re tools for different contexts. If your team needs structure and planned releases, Git Flow is the way. If you thrive on speed and continuous delivery, GitHub Flow keeps things lean. The key is consistency: once you pick a workflow, enforce it across the team.

 

Comments

No comments yet. Be the first to share your thoughts.

Leave a comment

RDA
Rashid Anwar
Independent Developer

I’m Rashid, an independent developer focused on practical software solutions for businesses.

HAVE A PROJECT IN MIND?

Let's talk about the problem you're trying to solve.

Share what you need. We can discuss the requirements and a practical next step.

Start a Conversation