Git - Feature branch model

Whether you use Git with a centralized repository (like Github or Bitbucket) or just a local copy, I would always advice you to use the Feature branch model as your Git workflow.

Here are the key points that describes the Git feature branch workflow:

  • No development happens or are pushed directly to the master branch.
  • Create a new branch, a feature branch, when you start development on a new feature.
  • Feature branches should have descriptive names, like add-printing-stylesheet.
  • When the feature is finished, you merge in into master or create a pull request if you use a central repository and use pull requests / code review.
  • When it’s merged, delete the feature branch. Keep the branches as short lived as possible.

If you follow this you will always have a working master branch and all feature development is isolated from the main codebase until they are finished.