One of the best practices about Git-flow

One of the best practices about Git-flow

·

2 min read

Currently, I'm working on a co-system project, which is using to manage customers, products, etc. Although Web Front-end team size is two, using Git-flow is necessary and important.

  1. Init

    git flow init -d
    

    Just using default configurations:

    • Branch is used for bringing forth production releases: master
    • Branch is used for integration of the next release: develop
    • Feature branches? [feature/]
    • Bugfix branches? [bugfix/]
    • Release branches? [release/]
    • Hotfix branches? [hotfix/]
    • Support branches? [support/]
    • Version tag prefix? []
  2. Start feature branch

    git flow feature start <feature_name>
    

    A new branch with naming convention feature/ will be created based on 'develop'. After committed code, do

    git flow publish <feature_name>
    

    And when we have done all functions in this feature, just run

    git flow finish <feature_name>
    

    Then branch feature/<feature_name> will be merged to develop and deleted also. Now we are in branch develop, just push it on.

  3. Start release branch

    git flow release start <release_name>
    git flow finish <release_name>
    git push origin --tags
    

    A new branch naming convention release/ will be created based on develop then merge into master and merge back to develop. Need to run git push origin --tags to publish tags and release version.

  4. Start hotfix branch

    git flow hotfix start <hotfix_name>
    git flow finish <hotfix_name>
    

    A new branch naming convention hotfix/ will be created based on master then merge into develop and merge back to master.

More information, please check out at https://nvie.com/posts/a-successful-git-branching-model/