Ref: git-flow
Point of view
The overall flow of Gitflow is:
- A
develop
branch is created frommaster
- A
release
branch is created fromdevelop
Feature
branches are created fromdevelop
- When a
feature
is complete it is merged into thedevelop
branch - When the
release
branch is done it is merged intodevelop
andmaster
- If an issue in
master
is detected ahotfix
branch is created frommaster
- Once the
hotfix
is complete it is merged to bothdevelop
andmaster
Install
brew install git-flow
cd into project folder
git flow init
// Not using gir-flow git branch develop git push -u origin develop
When starting to work on new feature
git flow feature start <your-branch-name>
// Not using git-flow git checkout develop git checkout -b feature_branch
When finishing working on new feature
git flow feature finish <your-branch-name>
// Not using git-flow git checkout develop git merge feature_branch
You will see the following messages
- The feature branch ‘feature/<your-branch-name>’ was merged into ‘develop’
- Feature branch ‘feature/<your-branch-name>’ has been removed
- You are now on branch ‘develop’
Release a branch
Create release branch
git flow release start 1.0.0
// Not using git-flow git checkout develop git checkout -b release/1.0.0
Merge release branch to master
git flow release finish '1.0.0'
// Not using git-flow git checkout master git merge release/1.0.0
Hot fix
Create hot fix branch
git flow hotfix start hotfix_branch
// Not using git-flow git checkout master git checkout -b hotfix_branch
Release hot fix branch
git flow hotfix finish hotfix_branch
// Not using git-flow git checkout master git merge hotfix_branch git checkout develop git merge hotfix_branch git branch -D hotfix_branch
Leave a Reply