Pick Your Model

Match the workflow to your release cadence and team maturity. Don't over-engineerβ€”start simple.

Feature Branchany team Β· any cadence Β· low complexity
GitHub Flowweb apps Β· continuous delivery Β· low complexity
Gitflowscheduled releases Β· versioned libs Β· high complexity
Trunk-Basedmature CI Β· microservices Β· medium complexity
Most Common

Feature Branch

One branch per feature, cut from main. Work in isolation, push when ready, merge after review. The safe default for any team. Works with any release cadence and enforces code review without added process overhead.

git done                           # sync with latest main first
git cb feature/user-auth           # create & switch
git ap && git cm "feat(auth): add OAuth flow"
git publish                        # push & track β†’ open PR
  • Branch lives only as long as the feature β€” delete after merge
  • main stays deployable at all times
  • PR review is built naturally into the flow
  • Combine with conventional commits for readable merge history
CD-Friendly

GitHub Flow

A deployment-first variant of Feature Branch. main is always production-ready. Branch β†’ commit β†’ deploy to staging β†’ review β†’ merge β†’ auto-deploy. Simpler than Gitflow; great for products shipping multiple times per day.

git cb feature/dark-mode
# develop, commit, push
git publish
# β†’ deploy branch to staging β†’ PR review β†’ merge β†’ CI deploys main
  • No develop branch β€” main is the single integration point
  • Every PR gets a preview deploy before it touches main
  • Requires a reliable CI/CD pipeline to be safe
  • Best for SaaS products and APIs with frequent deploys
Release-Based

Gitflow

Two permanent branches: main (production) and develop (integration). Features branch from develop; release branches stabilize before tagging main; hotfixes go straight to main and back to develop.

# feature work β€” branches off develop
git cb feature/payment develop
git cm "feat(payment): stripe integration"
# β†’ PR to develop when done

# prepare release
git cb release/2.1.0 develop
# bump version, final fixes β†’ merge to main + tag + back-merge to develop

# urgent production fix
git cb hotfix/2.0.1 main
# β†’ merge to main + develop
  • Use for apps with defined release windows or versioned libraries
  • Supports parallel work on multiple releases simultaneously
  • More overhead β€” branches: feature/*, release/*, hotfix/*
  • Not ideal for continuous delivery β€” adds friction on every ship
Needs Mature CI

Trunk-Based Development

Everyone commits to main (trunk) frequently β€” ideally multiple times per day. Feature branches are optional and short-lived (hours, not weeks). Incomplete work is hidden behind feature flags, not long-lived branches.

# short-lived branch β€” same-day merge target
git cb feat/quick-change
git cm "feat: add tooltip on hover"
git publish
# β†’ fast review β†’ merge same day β†’ branch deleted

# direct commit with feature flag guard
git cm "feat: scaffold [FF: new-checkout] skeleton"
git ps
  • Branches live ≀ 2 days β€” anything longer is a code smell here
  • Requires fast, reliable automated tests on every commit
  • Feature flags manage incomplete work already in production
  • Reduces merge conflicts drastically on large teams

At a Glance

Comparison of feature branch, GitHub Flow, Gitflow, and trunk-based development.
CriteriaFeature BranchGitHub FlowGitflowTrunk-Based
ComplexityLowLowHighMedium
Release cadenceAnyContinuousScheduledContinuous
Long-lived branchesmainmainmain + developmain only
Needs CI/CDOptionalRequiredOptionalRequired
Good forMost teamsSaaS / webVersioned appsMicroservices

Daily Commands

These git-devkit aliases work with any workflow. Adapt branch names to your chosen model.

git done                      # sync with latest main (fetch + rebase)
git cb feature/name           # create & switch to branch
git s                         # quick status check
git ap                        # stage intentional hunks, not whole files
git ds                        # review staged diff before committing
git cm "feat(scope): message" # conventional commit
git lg                        # inspect local history
git publish                   # push & set upstream tracking
git cleanup                   # delete all merged branches

Apply It in Your Team

Start with Feature Branch if you're unsure β€” it's the easiest to adopt and covers 90% of team needs. Layer in the others as your process matures.