Julien Danjou

Sep 4, 2025

6 min

read

Feature Branch Workflow: A Practical Guide for Git

Stay ahead in CI/CD

The latest blog posts, release news, and automation tips straight in your inbox

Stay ahead in CI/CD

The latest blog posts, release news, and automation tips straight in your inbox

A feature branch workflow is one of Git’s most popular strategies. Learn how it works, its pros and cons, and how modern automation (like merge queues) keeps feature branches fast, safe, and frustration-free.

PFeature branching is one of the most common Git workflows. It’s simple: every new feature (or bugfix) gets its own branch, built off the mainline, worked on in isolation, and merged back once ready.

It keeps main (or master) stable. It lets developers work in parallel. And with modern tooling, it ties directly into pull requests, reviews, and CI pipelines.

In this guide, we'll break down how feature branch workflow actually works, its pros and cons, and where it fits compared to other models like trunk-based development.

🤓 What Is a Feature Branch?

In Git, a feature branch is just a branch created to work on one unit of change — a new feature, bugfix, or refactor.

The idea: keep risky or unfinished work away from the main branch until it's ready.

  • You create it using the latest main (or develop).

  • You commit and push changes there.

  • You open a pull request to merge it back once complete.

A branch is any line of development. A feature branch is tied explicitly to delivering a feature or fix.

🛠 How to Create a Feature Branch in Git

  1. Start from the main branch

    git checkout main
    git pull
  2. Create a new branch

    git checkout -b feature/awesome-new-thing
  3. Naming tip: use a prefix like feature/ or bugfix/, followed by a ticket ID or description.

  4. Push commits

    git add <file>
    git commit -m "Add new feature"
  5. Push to remote

    git push -u origin feature/awesome-new-thing
  6. Open a pull request

    Team members review, leave comments, request fixes.

  7. Merge

    Resolve conflicts if needed, get approvals, then merge into main.

❤️ Why Teams Use Feature Branches

  • Isolation → risky code doesn’t pollute main.

  • Parallel work → multiple features can be built at once.

  • Code review built in → PRs become a natural review checkpoint.

  • CI/CD integration → tests run before merges.

😢 The Downsides

  • Long-lived branches = merge hell. The longer you keep a branch open, the harder the merge.

  • Context switching → reviewers face huge PRs if features balloon.

  • Slower integration → compared to trunk-based, changes hit production later.


Feature Branch vs Release Branch

  • Feature branch → built for one feature/fix, merged when complete.

  • Release branch → holds a set of features stabilizing for release, only critical fixes allowed.

Develop vs Feature Branch in Git

  • Develop branch → an integration branch before main, common in Gitflow.

  • Feature branches → spun off develop, then merged back.

  • Many modern teams skip develop entirely, merging features directly into main with proper automation.

🚦 Getting Back to a Feature Branch

List branches:

Switch to one:


Our Take: Feature Branches Are a Tool, Not a Religion

Feature branches work well for teams that value isolation and clear review checkpoints. However, if left open too long, they can also slow you down.

That's why many teams evolve toward short-lived branches + merge automation — closer to trunk-based development, but still with the safety of PRs.

This is where Mergify helps:

  • Merge Queue → keeps branches up to date and merges in order without hammering CI.

  • Automation rules → define exactly when a PR is ready to merge.

  • CI Insights → spot flaky tests or bottlenecks before they block merges.

Feature branches don't have to mean merge pain. With the right guardrails, they become part of a smooth, fast workflow.

Stay ahead in CI/CD

The latest blog posts, release news, and automation tips straight in your inbox

Stay ahead in CI/CD

The latest blog posts, release news, and automation tips straight in your inbox

Recommended blogposts

Nov 5, 2025

5 min

read

Shadow Shipping: How We Double-Executed Code to Ship Safely

How do you ship risky code without crossing your fingers? In this post, we explain how he ran old and new logic in parallel (“shadow shipping”) to validate behavior in production before rollout. Learn how this simple pattern turned feature-flag anxiety into data-driven confidence.

Julian Maurin

Nov 5, 2025

5 min

read

Shadow Shipping: How We Double-Executed Code to Ship Safely

How do you ship risky code without crossing your fingers? In this post, we explain how he ran old and new logic in parallel (“shadow shipping”) to validate behavior in production before rollout. Learn how this simple pattern turned feature-flag anxiety into data-driven confidence.

Julian Maurin

Nov 5, 2025

5 min

read

Shadow Shipping: How We Double-Executed Code to Ship Safely

How do you ship risky code without crossing your fingers? In this post, we explain how he ran old and new logic in parallel (“shadow shipping”) to validate behavior in production before rollout. Learn how this simple pattern turned feature-flag anxiety into data-driven confidence.

Julian Maurin

Nov 5, 2025

5 min

read

Shadow Shipping: How We Double-Executed Code to Ship Safely

How do you ship risky code without crossing your fingers? In this post, we explain how he ran old and new logic in parallel (“shadow shipping”) to validate behavior in production before rollout. Learn how this simple pattern turned feature-flag anxiety into data-driven confidence.

Julian Maurin

Oct 29, 2025

6 min

read

Why PostgreSQL Ignored Our Index (and What the Planner Was Thinking)

PostgreSQL doesn’t "ignore" your indexes, it just does the math differently. We dive into how the planner weighs cost, why it sometimes chooses sequential scans, and how we tuned our queries to make peace with it.

Fabien Martinet

Oct 29, 2025

6 min

read

Why PostgreSQL Ignored Our Index (and What the Planner Was Thinking)

PostgreSQL doesn’t "ignore" your indexes, it just does the math differently. We dive into how the planner weighs cost, why it sometimes chooses sequential scans, and how we tuned our queries to make peace with it.

Fabien Martinet

Oct 29, 2025

6 min

read

Why PostgreSQL Ignored Our Index (and What the Planner Was Thinking)

PostgreSQL doesn’t "ignore" your indexes, it just does the math differently. We dive into how the planner weighs cost, why it sometimes chooses sequential scans, and how we tuned our queries to make peace with it.

Fabien Martinet

Oct 29, 2025

6 min

read

Why PostgreSQL Ignored Our Index (and What the Planner Was Thinking)

PostgreSQL doesn’t "ignore" your indexes, it just does the math differently. We dive into how the planner weighs cost, why it sometimes chooses sequential scans, and how we tuned our queries to make peace with it.

Fabien Martinet

Oct 23, 2025

5 min

read

The Magic (and Mayhem) Behind Our Config Deprecation Transformers

We built a "self-healing" system that fixes deprecated configs by opening PRs automatically. It worked like magic, until it didn't. Here's what we learned about the thin line between elegant automation and uncontrollable complexity.

Guillaume Risbourg

Oct 23, 2025

5 min

read

The Magic (and Mayhem) Behind Our Config Deprecation Transformers

We built a "self-healing" system that fixes deprecated configs by opening PRs automatically. It worked like magic, until it didn't. Here's what we learned about the thin line between elegant automation and uncontrollable complexity.

Guillaume Risbourg

Oct 23, 2025

5 min

read

The Magic (and Mayhem) Behind Our Config Deprecation Transformers

We built a "self-healing" system that fixes deprecated configs by opening PRs automatically. It worked like magic, until it didn't. Here's what we learned about the thin line between elegant automation and uncontrollable complexity.

Guillaume Risbourg

Oct 23, 2025

5 min

read

The Magic (and Mayhem) Behind Our Config Deprecation Transformers

We built a "self-healing" system that fixes deprecated configs by opening PRs automatically. It worked like magic, until it didn't. Here's what we learned about the thin line between elegant automation and uncontrollable complexity.

Guillaume Risbourg

Curious where your CI is slowing you down?

Try CI Insights — observability for CI teams.

Curious where your CI is slowing you down?

Try CI Insights — observability for CI teams.

Curious where your CI is slowing you down?

Try CI Insights — observability for CI teams.

Curious where your CI is slowing you down?

Try CI Insights — observability for CI teams.