Git Flow is a popular Git workflow model designed to better manage branches and version control in Git repositories. It was introduced by Vincent Driessen in a blog post and has been widely adopted. Git Flow defines a set of strict branch naming conventions and branch purposes so that team members can better collaborate on development and manage software projects. The workflow includes the following main branches:
- Master Branch: Represents the main stable version, used for releasing production environment code. Usually contains the latest releasable code that has been tested and reviewed.
- Develop Branch: The development branch containing the latest development code. All feature development, bug fixes, etc., are performed on this branch.
- Feature Branch: Used for individual feature development, typically created from the Develop branch and merged back to the Develop branch upon completion.
- Release Branch: Used for release preparation. When sufficient features have accumulated on the Develop branch, a Release branch is created from the Develop branch for final testing and bug fixes, then merged back to both Master and Develop branches.
- Hotfix Branch: Used for emergency fixes of bugs in the production environment. Created from the Master branch, and merged back to both Master and Develop branches after fixing.
Git Flow, through this branch management approach, enables teams to collaborate better while ensuring stability and reliability during development and release processes. This workflow is widely used by many software development teams and is considered a mature, reliable Git workflow model.
Basic Format:
<type>(<scope>): <subject>
<body>
<footer>
Type:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Code style changes (formatting, missing semicolons, etc.)refactor
: Code refactoring (neither new features nor bug fixes)test
: Adding or modifying testschore
: Build process or auxiliary tool changesperf
: Performance improvementsci
: Continuous integration changesbuild
: Build system or dependency changesrevert
: Reverting previous commitsScope:
api
, ui
, auth
, database
Subject:
Body (Optional):
Footer (Optional):
Closes #123
BREAKING CHANGE: API endpoint changed
Simple Examples:
feat(auth): add login functionality
fix(api): resolve user data validation issue
docs: update README installation guide
style: format code with prettier
Detailed Examples:
feat(user-profile): add avatar upload functionality
Allow users to upload and change their profile avatars.
Supports JPEG and PNG formats up to 2MB.
Includes image validation and automatic resizing.
Closes #456
fix(payment): resolve checkout button not responding
The checkout button was not responding due to missing event
listener binding after dynamic content loading.
Fixed by ensuring event listeners are reattached after DOM updates.
Fixes #789
Pattern:
<type>/<date>-<description>-<developer>
Components:
Type:
feature
: New feature developmentbugfix
: Bug fixeshotfix
: Emergency production fixesrelease
: Release preparationchore
: Maintenance tasksDate:
YYYYMMDD
Description:
Developer:
feature/20250807-user-authentication-john
bugfix/20250807-payment-validation-sarah
hotfix/20250807-security-patch-mike
release/20250807-v2.1.0-team
chore/20250807-dependency-update-alice
Following these Git operation guidelines ensures:
These guidelines should be adapted to fit your team’s specific needs while maintaining the core principles of clarity, consistency, and collaboration.