GIT FLOW

Documentation

Principles

  • source collaboration
  • git flow = branching model

FLOW

  • types of BRANCHES

    1. master
    2. develop
    3. feature = ALWAYS branched from and merged back into develop
    4. release = branched from develop, merged into develop and master
    5. hotfix = branched from master, merged into develop and master
  • STEPS FOR A NEW FEATURE:

    1. git checkout -b myfeature develop
    2. git checkout develop
    3. git merge --no-ff myfeature
    4. git branch -d myfeature
    5. git push origin develop

  • STEPS FOR A RELEASE - EVERY COMMIT ON MASTER IS A NEW RELEASE
    1. git checkout -b release-1.2 develop
    2. bump version to 1.2 (package.json)
    3. git commit -a -m "Bumped version number to 1.2"
    4. git checkout master
    5. git merge --no-ff release-1.2
    6. git push
    7. git checkout develop
    8. git merge --no-ff release-1.2
    9. git push
    10. git tag -a 1.2
    11. git push tags
    12. git branch -d release-1.2

  • STEPS FOR A HOTFIX: same steps as for a release branch but
    • use hotfix prefix: bugfix-1.2.1 // NB: semantic versioning

DEPLOY

  • ENVIRONMENTS:

    • LOCAL,
    • DEVELOPMENT corresponds to develop branch
    • ACCEPTANCE corresponds to master branch
    • PRODUCTION corresponds to RELEASE TAG
  • bugfixes are a special type of branch on a par with a feature branch:

    • split from and merged back into develop
  • hotfixes are split from and merged back into master