Git branching strategies

less complex
-->
more complex

Only for remote

You can do whatever you want on your own machine, nobody cares about that.

Trunk based development

Pros

  • Very easy to handle on the Git side
     
  • simple to understand at first
     
  • fully linear history, no merges

Requirements / "problems"

  • No broken code in master
     
  • Feature flags are essential
     
  • Tests should have high coverage
     
  • Code review?
     
  • more code is needed to handle workflow
    (e.g. feature flags)

GitHub flow

Pros

  • scales indefinitely
     
  • easy and simple
     
  • fast switch features during development

Cons

  • frequent rebase is needed (can be +/-)
     
  • conflict resolution is lost (vs merge)

Git flow

Pros

Jokes aside, I never understood why
is this a good idea.

Cons

  • Too complex
     
  • double mistakes are possible
    (merge to dev and then to master)
     
  • too much "administration"
     
  • develop branch lags behind production
    too much
     
  • slow synchronization between branches
    (and therefore between developers)

Git branching strategies

By Kiss György

Git branching strategies

  • 200