GitFlow Process Overview
GitFlow Process Overview
GitFlow is a branching model for Git, proposed by Vincent Driessen, that provides a structured workflow to
manage feature development, releases, and hotfixes. It emphasizes the use of dedicated branches for
specific tasks, which makes collaboration and version control easier, especially for teams working on large
or complex projects.
2. Develop Branch
- The integration branch for ongoing development.
- Developers branch off from here to work on features and bug fixes.
- After features are complete and tested, they are merged back into the develop branch.
- Represents the latest completed development, but not yet released.
3. Feature Branches
- Used to develop new features.
- Branch from the `develop` branch and merge back into it when the feature is complete and tested.
- Named conventionally as `feature/feature-name`.
5. Release Branches
- Created from the `develop` branch when preparing for a new production release.
- Dedicated to release preparations (e.g., testing, bug fixing, and final tweaks).
- Merges into both `main` and `develop` after the release is finalized.
- Named as `release/release-name`.
6. Hotfix Branches
- Used for quick fixes on the production code (i.e., emergencies).
- Branch from `main` and merge back into both `main` and `develop` to ensure the fixes are reflected
in the ongoing development.
1. Feature Development
- Developers create a `feature/` branch from `develop` to work on individual tasks.
- Once the feature is complete, it's merged back into `develop`.
2. Release Preparation
- When ready for release, a `release/` branch is created from `develop`.
- Bug fixes or final adjustments are made here.
- The release branch is merged into both `main` and `develop`.
3. Hotfixes
- If a critical bug is found in production, a `hotfix/` branch is created from `main`.
- The fix is made and merged back into both `main` and `develop` to keep the branches in sync.
Benefits of GitFlow vs. Using Main as the Release Branch
1. Structured Workflow
- GitFlow provides a structured workflow that clearly defines the purpose of each branch. This avoids
confusion and helps teams work on features, bug fixes, and releases without interfering with each
other.
4. Safe Hotfixes
- Hotfixes can be applied directly to the `main` branch without interrupting the development process.
Since the hotfix is also merged back into `develop`, the changes are carried forward into future
releases.
5. Collaborative Development
- GitFlow makes it easy for multiple developers to collaborate on different features without conflict. The
branching model encourages isolation and regular integration into the develop branch, which reduces
merge conflicts and ensures a smooth workflow.
6. Improved Stability
- Since `main` only contains production-ready code, it remains stable. There’s no risk of accidentally
deploying incomplete or unstable features to production.
Conclusion
GitFlow offers a more organized and controlled way to handle feature development, releases, and urgent
fixes compared to working directly off the `main` branch. It helps teams avoid merge conflicts, improve
code stability, and ensure that releases are well-prepared. For teams looking for a more robust workflow,
GitFlow can streamline processes and improve collaboration.
FAQ
1. What if we find a bug in UAT?
Code is branched off from release branch and pushed back to QA and UAT. We do not merge back to
DEVELOP until the release is deployed to Production.
4. Does HOTFIX get merged to current release branch if HOTFIX was just released to
Production?
HOTFIX gets merged to MAIN and DEVELOP branch once released to Production. Any project queued for
release should be updated from the MAIN branch as per GITFlow.