# Git Flow — A Structured Branching Model for Team Projects > Git extensions that implement Vincent Driessen's branching model for structured release management and team collaboration. ## Install Save as a script file and run: # Git Flow — A Structured Branching Model for Team Projects ## Quick Use ```bash # Install on macOS brew install git-flow # Initialize in a repository git flow init # Start a new feature git flow feature start my-feature # Finish and merge back git flow feature finish my-feature ``` ## Introduction Git Flow provides a set of git extensions that enforce Vincent Driessen's branching model. It gives your repository a consistent structure with dedicated branches for features, releases, and hotfixes, making parallel development and release management predictable. ## What Git Flow Does - Adds high-level commands like `git flow feature start` and `git flow release finish` on top of standard git - Manages a `develop` branch for integration alongside `main` for production releases - Automates branch creation, merging, and tagging for features, releases, and hotfixes - Enforces a naming convention so every team member follows the same workflow - Supports parallel feature development without polluting the release pipeline ## Architecture Overview Git Flow is a collection of shell scripts that wrap standard git commands. When you run `git flow init`, it sets up the branch naming scheme. Each subcommand (feature, release, hotfix, support) creates a temporary branch from the correct base, and the finish step merges it back, optionally tagging the result. No server component or daemon is required. ## Self-Hosting & Configuration - Install via Homebrew, apt, or the raw install script from the repository - Run `git flow init` in any existing repo to configure branch prefixes - Customize branch names (e.g., `production` instead of `main`) during initialization - Works with any remote hosting: GitHub, GitLab, Bitbucket, or self-hosted servers - Configuration is stored in `.git/config` so it stays local to each clone ## Key Features - Zero-dependency shell scripts that work on Linux, macOS, and Windows (via Git Bash or WSL) - Clear separation between work-in-progress (develop) and production-ready code (main) - Built-in support for semantic versioning through release branches and tags - Hotfix workflow lets you patch production without disrupting ongoing feature work - Widely adopted model with editor and IDE integrations across the ecosystem ## Comparison with Similar Tools - **GitHub Flow** — simpler single-branch model suited for continuous deployment; Git Flow is better when you maintain multiple release versions - **GitLab Flow** — adds environment branches on top of GitHub Flow; Git Flow provides more rigid structure - **Trunk-Based Development** — favors short-lived branches and feature flags; Git Flow is more explicit about release gates - **git-town** — automates common branching patterns with fewer opinions; Git Flow enforces a specific model ## FAQ **Q: Is Git Flow still relevant with CI/CD?** A: Yes, especially for projects that ship versioned releases (libraries, mobile apps, on-prem software). For pure continuous deployment, simpler flows may suffice. **Q: Can I use Git Flow with pull requests?** A: Absolutely. Create the branch with `git flow feature start`, push it, open a PR, and once merged use `git flow feature finish` locally. **Q: What happens if I abandon a feature branch?** A: Simply delete it with `git branch -d feature/name`. Git Flow does not enforce completion. **Q: Does Git Flow work with monorepos?** A: It works at the repository level, so yes. However, for very large monorepos, trunk-based development is often preferred. ## Sources - https://github.com/nvie/gitflow - https://nvie.com/posts/a-successful-git-branching-model/ --- Source: https://tokrepo.com/en/workflows/asset-4f673345 Author: Script Depot