Skip to content

Instantly share code, notes, and snippets.

@royling
Last active November 4, 2016 06:17
Show Gist options
  • Save royling/e697521854325e36d3f1e4f3f6d42104 to your computer and use it in GitHub Desktop.
Save royling/e697521854325e36d3f1e4f3f6d42104 to your computer and use it in GitHub Desktop.
A git branching model

The key rules of this model are:

  • origin/master always reflects a production-ready state.
  • origin/develop always reflects a state with the latest delivered development changes for the next release.
  • Each time when changes are merged back into master, it's a new production release.
  • Other branch types supporting other purposes:
    1. feature/topic branches: develop new features for the upcoming or a distant future release.
      • branch off from develop and merge back to develop once finished.
      • typically exist in developer repos only, not in origin.
      • exists as long as the feature is in development, eventually merged or discarded.
    2. release branches: support preparation of a new production release (minor bug fixes and preparing meta-data for a release).
      • branch off from develop and merge back to develop & master.
      • benefit: develop branch is cleared to receive features for the next big release.
      • may exist there for a while, until the release may be rolled out definitely.
      • bug fixes may be applied in this branch during the time.
      • merge into master and add a tag for final release, and changes in this branch must be merged back into develop branch.
    3. hotfix branches: resolve a critical bug in production and are meant to prepare for a new production release, albeit unplanned.
      • branch off from master and merge back to master & develop.
      • bump the version number after branching off!
      • when a release branch currently exists, the hotfix changes need to be merged into that release branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment