Gitflow双工作流适配:能否设置两个Develop分支区分迭代类型?
Great question! Having two parallel develop-style branches is totally a viable way to separate your weekly small-change iterations and bi-weekly feature-focused cycles. Let’s walk through how to implement this smoothly, plus key considerations to keep your workflow consistent:
1. Branch Structure Setup
Instead of a single develop branch, create two dedicated integration branches:
develop-small: For weekly work like bug fixes, minor UI tweaks, non-breaking configuration updates, and small enhancementsdevelop-feature: For bi-weekly feature work—new functionality, large refactors, breaking changes, or anything that requires more time to complete
From these, your team will branch off corresponding feature branches:
- Small change branches: Name them clearly (e.g.,
fix/login-button-spacing,tweak/email-notification-text) and base them ondevelop-small - Feature branches: Use a distinct prefix (e.g.,
feature/checkout-redesign,feature/user-dashboard) and base them ondevelop-feature
2. Release Workflow Breakdown
Weekly Small Change Release
When it’s time to ship your weekly updates:
- Create a release branch from
develop-small(e.g.,release/v1.2.4) - Run final testing, fix any last-minute release-specific bugs
- Merge the release branch into both
main(for production) anddevelop-small(to sync any release fixes back to the integration branch) - Tag the
maincommit with the release version (e.g.,v1.2.4)
Bi-Weekly Feature Release
For your larger feature release, you’ll need to sync in recent small changes first:
- Merge
develop-smallintodevelop-feature: This ensures all weekly fixes and tweaks are included with the new features - Create a release branch from
develop-feature(e.g.,release/v1.3.0) - Test thoroughly—pay extra attention to integration between new features and recent small changes
- Merge the release branch into
mainanddevelop-feature - Tag the
maincommit with the feature release version - Finally, merge the updated
develop-featureback intodevelop-smallto keep the weekly branch up-to-date with completed features
3. Critical Best Practices
- Document the workflow: Make sure your entire team understands which branch to use for what work—add a section to your team’s Git guide or repo README to avoid mix-ups
- Sync branches regularly: Don’t let
develop-smallanddevelop-featuredrift too far apart. Sync them at least once a week (right after the weekly release is ideal) to minimize merge conflicts later - Adjust CI/CD pipelines: Set up separate test runs for both integration branches, and consider staging environments for each—one to preview weekly small changes, another to preview upcoming features
- Hotfixes still follow standard Gitflow: When you need to fix a production issue, branch off
main, make the fix, then merge it back intomain,develop-small, anddevelop-featureto ensure all branches get the critical patch
4. Alternative: Feature Flags (If Dual Branches Feel Too Heavy)
If maintaining two integration branches seems like extra overhead, you could stick with a single develop branch and use feature flags instead:
- Wrap all bi-weekly feature work behind toggleable flags
- For weekly releases, disable any unfinished feature flags before deploying
- When the bi-weekly cycle ends, enable the ready feature flags and ship the release
This reduces branch complexity but requires strict flag hygiene—make sure to remove old flags once features are fully launched and tested.
内容的提问来源于stack exchange,提问作者Jamie H

