Git Flow Workflow Guide
This guide explains the Git Flow branching model implemented in the Remind Tools project for coordinated development across the Flutter monorepo.Overview
Git Flow provides a robust framework for managing releases and feature development in our multi-platform Flutter applications. Our implementation coordinates development between two main applications (Trips and Money) and shared packages.Branch Structure
Core Branches
main
- Production Branch
- Purpose: Production-ready code with tagged releases
- Stability: Always deployable to production
- Protection: Fully protected, requires PR approval
- Merges From: release/ and hotfix/ branches only
- Deployments: Automatic to production environments
develop
- Integration Branch
- Purpose: Main development integration branch
- Stability: Should always build and pass tests
- Protection: Protected, requires PR reviews
- Merges From: feature/ and bugfix/ branches
- Activity: Daily integration of completed features
Supporting Branches
feature/
- Feature Development
- Naming:
feature/[issue-number]-[feature-name]
- Base: Created from
develop
- Merge To:
develop
via Pull Request - Lifetime: Until feature completion and merge
- Purpose: Individual feature development
release/
- Release Preparation
- Naming:
release/[version]
(e.g.,release/1.2.0
) - Base: Created from
develop
- Merge To: Both
main
anddevelop
- Purpose: Release stabilization and bug fixes
- Content: Only bug fixes, no new features
hotfix/
- Emergency Fixes
- Naming:
hotfix/[version]
(e.g.,hotfix/1.2.1
) - Base: Created from
main
- Merge To: Both
main
anddevelop
- Purpose: Critical production bug fixes
- Priority: Immediate deployment required
bugfix/
- Development Bug Fixes
- Naming:
bugfix/[issue-number]-[bug-description]
- Base: Created from
develop
- Merge To:
develop
via Pull Request - Purpose: Non-critical bug fixes during development
Claude Code Integration
Git Flow Commands
The project includes specialized Claude Code commands for Git Flow operations:/gitflow-start-feature
Initializes new feature development with proper environment setup:
- Creates feature branch from develop
- Runs melos bootstrap
- Validates development environment
- Sets up VS Code workspace
/gitflow-start-feature payment-integration
/gitflow-finish-feature
Completes feature development with quality validation:
- Runs comprehensive test suite
- Validates code quality and coverage
- Creates pull request to develop
- Handles CI/CD integration
/gitflow-finish-feature "Add payment processing"
/gitflow-start-release
Begins release preparation with version management:
- Creates release branch from develop
- Coordinates version bumping with Melos
- Prepares platform-specific configurations
- Sets up QA testing environment
/gitflow-start-release 1.2.0
/gitflow-finish-release
Completes release with production deployment:
- Merges to both main and develop
- Creates version tags
- Coordinates multi-platform deployment
- Updates documentation and changelogs
/gitflow-finish-release "Release v1.2.0 with new features"
/gitflow-hotfix
Handles emergency production fixes:
- Creates hotfix branch from main
- Implements rapid fix with testing
- Coordinates emergency deployment
- Manages incident communication
/gitflow-hotfix "Critical payment bug P0"
/gitflow-status
Monitors Git Flow state and branch health:
- Shows current branch status
- Analyzes workflow health
- Identifies merge conflicts
- Reports team activity
/gitflow-status overview
Development Workflow
Starting New Feature Development
-
Initialize Feature Branch
Or manually:
-
Development Process
- Follow Clean Architecture patterns
- Write comprehensive tests
- Use conventional commit messages
- Push regularly for backup
-
Complete Feature
Release Management
-
Prepare Release
-
Stabilization Period
- Only bug fixes allowed
- QA testing coordination
- Platform-specific testing
- Documentation updates
-
Complete Release
Emergency Hotfixes
-
Emergency Response
-
Rapid Development
- Minimal viable fix
- Targeted testing
- Emergency deployment
- Team communication
Monorepo Considerations
Package Coordination
Cross-Package Changes- Use workspace scope in commits:
feat(workspace):
- Coordinate version bumping with Melos
- Test impact across all applications
- Use app scope:
feat(trips):
orfeat(money):
- Test platform-specific implementations
- Coordinate release timing
Version Management
Semantic Versioning- MAJOR: Breaking API changes
- MINOR: New features, backward compatible
- PATCH: Bug fixes, backward compatible
Best Practices
Commit Messages
Feature BranchesBranch Protection Rules
Main Branch- Require PR reviews (2+ approvals)
- Require status checks (CI/CD)
- Require up-to-date branches
- Restrict push to admins only
- Require PR reviews (1+ approval)
- Require status checks (tests)
- Allow squash merging
- Delete head branches after merge
CI/CD Integration
Automated Testing- Unit tests on all branches
- Integration tests on develop/main
- Platform-specific tests on release branches
- Security scans on all PRs
- Staging deployment from develop
- Production deployment from main
- Release candidate builds from release branches
- Emergency deployment from hotfix branches
Team Coordination
Daily Workflow
-
Morning Sync
-
Feature Development
- Start from develop branch
- Regular commits with conventional format
- Push to remote frequently
-
End of Day
- Commit all work in progress
- Update PR descriptions
- Review team activity
Weekly Planning
-
Branch Cleanup
-
Release Planning
- Review features ready for release
- Plan release timeline
- Coordinate QA testing
-
Health Assessment
Troubleshooting
Common Issues
Merge ConflictsRecovery Procedures
Broken Develop Branch- Identify problematic commit
- Create hotfix if affecting production
- Revert or fix forward on develop
- Communicate with team
- Tag current state for recovery
- Revert to last known good state
- Deploy rollback immediately
- Fix forward in hotfix branch
Monitoring and Metrics
Key Metrics
Development Velocity- Features completed per sprint
- Average time from feature start to merge
- Code review turnaround time
- Test coverage percentage
- Bug escape rate to production
- Hotfix frequency and severity
- Branch merge success rate
- CI/CD pipeline success rate
- Time from develop to production
Regular Reviews
Weekly Health Check- Review branch status and conflicts
- Analyze merge patterns and bottlenecks
- Update process improvements
- Assess Git Flow effectiveness
- Review tool integration success
- Plan workflow optimizations