Skip to content
AthanasiosPavlou edited this page Nov 21, 2014 · 1 revision

The Basics

We will be working with Git as our version control system. The main advantage Git is providing us, is the branching capabilities. This will help us keep our work organised, and with minimal disruptions. Based on the principles described in [1] the following will be our typical workflow (with potential enhancements) along the way:

  • The main application branch will be the "master" branch.

  • A parallel branch is introduced, which is called the "develop" branch.

  • The "master" branch is our production-ready branch. In other words this is the branch that will incorporate all changes made by other branches and that will be build and deployed for public use.

  • The "develop" branch is the branch that all developers will be using. Therefore all developers will need to have selected the "develop" branch for checkout. Any changes made in the "develop" branch will need to be merged with the "master" branch.

  • The "develop" branch is a bit generic though. Therefore, when working on a new feature, we create a new branch off the "develop" branch, work on that until the feature is completed and then:

    • Merge the feature branch in the "develop" branch
    • Merge the "develop" branch in the "main" branch - this means the new feature has entered production so only do so once fully tested and ready.
  • To simplify things even more, a local branch per developer can be created. So for example, say Thanos needs to work on creating a new "like" button. Then the steps to follow are:

    • A new feature branch (i.e. "like button" branch) is created off the "develop" branch.
    • A new local branch "Local-Thanos-like-button" is created off the "like button" branch.
    • Thanos is developing the new feature on the "Local-Thanos-like-button" branch.
    • The same steps are above are performed by Christos, because he might be tackling part of this new feature.
    • Once finished, Thanos merges the "Local-Thanos-like-button" branch with the "like button branch"
    • Once finished Christos merges the "Local-Christos-like-button" branch with the "like button branch"
    • Then Thanos (or Christos) merge the "like button branch" with the "develop" branch.
    • The "develop" branch is tested and if all is OK, then Thanos or Christos, merge the "develop" branch with the "master" branch.
    • The production application now gets redeployed with the new and shiny like button functionality :-)

[1] http://nvie.com/posts/a-successful-git-branching-model/

Example of an advanced branching model:

Advanced branching model

Clone this wiki locally