Working on a small company with projects that could scale from a one-man team then suddenly to a 5-10 developers team, having a manageable code repository is a need.
- master
- develop
- hot-fix/{TASK-ID}-{task-summary}
- feat/{TASK-ID}-{feature-name}
- task/{TASK-ID}_{task-summary}
- bug-fix/{TASK-ID}-{task-summary}
- testing
- staging
- release/APPNAME-v1.0
- hot-fix/{TASK-ID}-{task-summary}
For feature/task implementation
- Devs create “develop” branch from “master” branch
- Devs config “name & email” before do anything on git
- Devs who work on specific feature create branch “feature/{TASK-ID}-{task-summary}” from “develop” branch
- Devs work together on “feature” branch, after finish, Devs pull newest code, merge with “develop” branch
- After finish feature, devs update CHANGELOG (if needed) and review code cross & squash code committed after finish branch and create MR to “develop” branch and assign to Leader (or Senior)
- Leader (or Senior) reviews and merges “feature” branch to “develop” branch
- When deploy on staging server, Leader create MR and merge from “ develop” to “staging” branch (Dev or Tester Test or UAT)
- When delivery on production server, Leader create MR and merge from “staging” to “master” branch (Go Live)
- OR When delivery on production server, Leader create new branch Release, MR from “staging” and then merge from “ Release” to “master” branch (Go Live)
- Leader create tag from “master” branch if needed (based on CHANGELOG)
For bug-fixes implementation
Same as feature implement work-flow above
For hot-fixes
- HotFix will be applied after each time delivers on production, then there are issues/bugs that need to fix asap.
- Devs create “hot-fix/{TASK-ID}-{task-summary}” branch from “master” branch
- Devs fix bug and commit/push on their branch and test on Staging or Test environment
- When delivery Devs will merge to “master” branch from “hot-fix/{TASK-ID}-{task-summary}” branch
- Devs will merge to the “develop” branch.
For testing (Test environment)
Use “develop” branch to test at test environment
For staging (Staging environment)
Use “staging” branch at staging environment
For Go Live (Production environment)
Use “master” branch at production environment