Skip to content

Branching Stragegies


Previously we discussed what a branch is in Git, how they are created and how to switch between branches. Now we will discuss different approaches to using branches, from the very simple to the complex.

Local Branches only Strategyλ︎

Branches created locally. Any changes to be shared are merged into the master branch first then that master branch is pushed to a common repository.

Advantagesλ︎

  • Very simple to use.
  • Only 1 branch to keep in sync with everyone else.

Limitationsλ︎

Github Pull Modelλ︎

Branches created locally. Any changes to be shared are merged into the master branch first then that master branch is pushed to a common repository.

Advantagesλ︎

  • Quite simple to use.
  • Can work with multiple shared branches
  • Provides easy way to review, discuss and document changes

Limitationsλ︎

  • Requires a services such as Github that supports pull requests

Git Flowλ︎

...

Advantagesλ︎

  • It makes you learn git really well
  • It can help with larger teams

Limitationsλ︎

  • It may be overkill
  • Learning curve for adoption, not to be rushed into
  • Need to ensure everyone understands the flow, human error easily introduced
  • Relying on tools to manage the flow can mean problems harder to fix if something goes wrong, as people may not understand the flow enough.

See the Git Flow section for more details.