65 Mins

9. Professional Git Workflows

Team Workflows

In a team of one, Git is just a backup system. In a team of ten, Git is a coordination protocol. Different teams use different branching strategies depending on their deployment frequency, team size, and release model. Understanding the dominant workflows is essential for joining any professional engineering team.

GitHub Flow — The Simple Modern Workflow

GitHub Flow is the most widely used workflow for web applications with continuous deployment. It has only one rule that matters: the main branch is always deployable.

1Create a branch

Off main. Name it after the feature or fix.

2Commit frequently

Small, focused commits with descriptive messages.

3Open a PR

Even if unfinished, to start discussion and get early feedback.

4Review & CI

Automated tests run. Teammates review code.

5Deploy from branch

Deploy the branch to a staging environment before merging.

6Merge to main

After approval and staging verification. Auto-deploys to production.

Gitflow — The Release-Based Workflow

Gitflow is used for software with scheduled releases (mobile apps, desktop software, enterprise products). It uses multiple long-lived branches:

  • main: Production-ready code only. Represents what is live right now. Tagged with version numbers.
  • develop: Integration branch. Features are merged here first and tested together.
  • feature/xxx: Feature branches forked from develop. Merged back to develop when complete.
  • release/x.x.x: Stabilisation branch. Created from develop when a release is approaching. Only bug fixes here.
  • hotfix/xxx: Emergency production fixes. Forked from main, merged to both main AND develop.
Gitflow was designed for versioned software. Do NOT use it for web apps with continuous deployment — it introduces unnecessary complexity and slow release cycles where GitHub Flow serves better.

Trunk-Based Development — The CI/CD Way

Trunk-Based Development (TBD) is the branching strategy used by Google, Meta, and high-velocity teams with mature CI/CD pipelines:

  • All developers commit directly to main (the trunk), multiple times per day
  • Branches, if used, live for hours — not days or weeks
  • Feature flags hide incomplete features in production code — they are deployed but switched off
  • Automated testing runs on every commit and prevents broken code from staying in trunk
  • Requires very high test coverage and strong CI/CD infrastructure — not suitable for every team

Knowledge Check

Ready to test your understanding of 9. Professional Git Workflows?

Back