How bharatdwarkani/gitflow-example works
1. What this repository is
- This is not an application repo; it is a documentation/sample repository for demonstrating the Gitflow branching model and the Gitflow Extension.
- The only tracked assets are README.md and LICENSE, so the “architecture” here is the branching and release workflow, not runtime code.
2. Primary purpose
- The repo exists to show how teams organize work into long-lived branches and short-lived task/release branches.
- It is meant to support a blog/tutorial workflow, with commands and branch transitions as the main content.
3. Main actors
- Developer workstation: where Git commands are run.
- Git for Windows: the base Git installation assumed by the instructions.
- Gitflow Extension / git-flow scripts: the command layer that creates and finishes branches.
- Remote Git repository (“origin”): the shared collaboration boundary where branches are published and merged.
4. Core branch structure
- master: the production/stable branch.
- develop: the integration branch where completed work accumulates before release.
- feature/*: short-lived branches for individual features, created from develop.
- release/*: stabilization branches prepared from develop.
- hotfix/*: urgent fix branches used for production issues.
5. Feature-flow architecture
- A developer starts from develop, creates a feature/feature1 branch, commits changes locally, then publishes that branch to the remote.
- When complete, the feature is finished back into develop, and the feature branch is deleted.
- This flow isolates ongoing work from the integration branch until the feature is ready.
6. Release-flow architecture
- A release branch is created from develop when the team wants to stabilize a version.
- Final fixes and version-specific changes happen on the release/* branch.
- The release is then merged back into both develop and master, representing promotion from integration to production.
7. Hotfix-flow architecture
- Hotfixes are intended for urgent production corrections.
- The hotfix branch is created from the production line, then published, completed, and merged back into the main branches.
- This preserves the ability to fix production without waiting for the normal development/release cycle.
8. Local vs. remote boundary
- The README distinguishes between local branch creation/commit and remote publication.
- git flow publish and git push move branch state to the shared repository.
- git flow finish performs the merge-and-cleanup step, typically removing the temporary branch after integration.
9. Tooling and setup boundary
- The repo assumes a Windows-oriented Gitflow installation path, including getopt.exe, libintl3.dll, and libiconv2.dll in Git’s bin directory.
- The gitflow extension itself is not stored in this repo; it is an external dependency cloned from nvie/gitflow.
- So the repo is a usage guide, not the implementation of Gitflow.
10. What a diagram should emphasize
- Draw this as a branch lifecycle diagram centered on master and develop.
- Show short-lived lanes for feature, release, and hotfix branches feeding back into the main branches.
- Include the developer CLI/tooling layer as the control plane and the remote origin as the collaboration boundary.
Main entry points: README.md Guide
Components 17
Local workstation
Developer-side Git commands and branch creation happen here.
- Guide · README-driven tutorial for the Gitflow branching model and extension usage.
README.md - Git for Windows · Base Git installation assumed by the instructions.
- Developer CLI · Where the developer runs Git and git-flow commands.
- Gitflow Ext · Command layer that creates, publishes, and finishes Gitflow branches.
Remote origin
Shared repository boundary for publishing and collaboration.
- Origin · Shared remote repository for publishing branches and merging results.
Branch model
Long-lived and short-lived branches used by Gitflow.
- master · Production and stable release line.
- develop · Main integration branch where completed work accumulates.
- feature/* · Feature work branches created from develop.
- release/* · Release branches used to prepare a version from develop.
- hotfix/* · Urgent production fix branches created from the production line.
Lifecycle flows
Branch creation, publishing, finishing, and promotion paths.
- Create feature · Start a feature branch from develop for isolated work.
- Publish feature · Push a feature branch to the remote repository.
- Finish feature · Merge feature work back into develop and delete the temporary branch.
- Create release · Branch from develop to stabilize an upcoming version.
- Finish release · Merge release changes back into develop and master.
- Create hotfix · Start an urgent fix from the production branch line.
- Finish hotfix · Merge urgent fixes back into develop and master.
Connections 26
- Guide → Developer CLI: documents · The guide explains the workflow commands and branch transitions.
- Developer CLI → Git for Windows: uses · Developer commands are executed through the local Git installation.
- Developer CLI → Gitflow Ext: invokes · git-flow commands are issued from the developer workstation.
- Gitflow Ext → develop: manages · Gitflow coordinates branching from the integration branch.
- Gitflow Ext → master: manages · Gitflow coordinates production-line merges and releases.
- Gitflow Ext → feature/*: creates · Feature branches are created as short-lived work lanes.
- Gitflow Ext → release/*: creates · Release branches are created for stabilization.
- Gitflow Ext → hotfix/*: creates · Hotfix branches are created for urgent production corrections.
- Create feature → feature/*: opens · A feature branch starts from develop.
- develop → Create feature: source · Develop is the source line for new feature work.
- feature/* → Publish feature: published by · Feature work is pushed to the remote when shared.
- Publish feature → Origin: pushes to · Publishing moves the feature branch to origin.
- feature/* → Finish feature: completed by · Finished feature work is merged back and cleaned up.
- Finish feature → develop: merges into · Completed features accumulate in develop.
- Create release → release/*: opens · Release stabilization branches are cut from develop.
- develop → Create release: source · Develop feeds the release branch creation step.
- release/* → Finish release: completed by · Release branch changes are finished after stabilization.
- Finish release → develop: merges into · Release work is promoted back to integration.
- Finish release → master: promotes to · Release work is also merged to production.
- Create hotfix → hotfix/*: opens · Hotfix branches start from the production line.
- master → Create hotfix: source · Master is the basis for urgent fixes.
- hotfix/* → Finish hotfix: completed by · Hotfixes are completed after the urgent correction is made.
- Finish hotfix → develop: merges into · Hotfix fixes are carried back into integration.
- Finish hotfix → master: merges into · Hotfix fixes are also merged into production.
- Origin → develop: shares · Remote origin serves as the collaboration boundary for branch state.
- Origin → master: shares · Production branch state is shared through origin.