Manage git-flow branching workflows. Use when working with feature branches, release branches, hotfixes, or configuring branching strategy...
Git-flow-next is a modern, Go-based implementation of the git-flow branching model with support for preset workflows (Classic GitFlow, GitHub Flow, GitLab Flow) and fully customizable branch configurations.
Prerequisites: git-flow-next must be installed. See references/installation.md for setup instructions.
Initialize your repository:
# Interactive (choose preset: classic, github, gitlab)
git-flow init
# With preset (no prompts)
git-flow init --preset=classic --defaults
# Custom configuration
git-flow init --custom
Common branch operations:
# Start and finish a feature
git-flow feature start my-feature
git-flow feature finish my-feature
# Start and finish a release
git-flow release start 1.2.0
git-flow release finish 1.2.0
# Emergency production fix
git-flow hotfix start 1.2.1
git-flow hotfix finish 1.2.1
Start a feature:
git-flow feature start authentication
Creates feature/authentication from develop.
Finish a feature:
git-flow feature finish authentication
developdevelopList active features:
git-flow feature list
Delete without merging:
git-flow feature delete authentication
Start a release:
git-flow release start 1.2.0
Creates release/1.2.0 from develop.
Finish a release:
git-flow release finish 1.2.0
mainmain with v1.2.0developList pending releases:
git-flow release list
Start a hotfix:
git-flow hotfix start 1.2.1
Creates hotfix/1.2.1 from main (critical: from production, not develop).
Finish a hotfix:
git-flow hotfix finish 1.2.1
mainmain with v1.2.1developList active hotfixes:
git-flow hotfix list
git-flow config list
Output shows your branch structure, prefixes, and merge strategies.
# Add production trunk
git-flow config add base production
# Add staging with auto-update
git-flow config add base staging production --auto-update=true
Options:
--upstream-strategy=merge|rebase|squash — Merge strategy when finishing--downstream-strategy=merge|rebase — Merge strategy when updating from parent--auto-update=true|false — Auto-update from parent on finish (default: false)# Add custom feature branch
git-flow config add topic feature develop --prefix=feat/
# Release with tagging
git-flow config add topic release main --starting-point=develop --tag=true
# Bugfix branch (alternative to feature)
git-flow config add topic bugfix develop --prefix=bugfix/
Topic Options:
--prefix=prefix — Branch name prefix (default: name/)`--starting-point=branch — Create from this branch (default: parent)--upstream-strategy=merge|rebase|squash — Merge strategy--downstream-strategy=merge|rebase — Update strategy--tag=true|false — Create tags on finish (default: false)# Change merge strategy for features
git-flow config edit topic feature --upstream-strategy=rebase
# Disable auto-update on staging
git-flow config edit base staging --auto-update=false
# Remove custom branch type
git-flow config delete topic bugfix
# Remove base branch from git-flow (keeps Git branch)
git-flow config delete base staging
Git-flow-next supports merge, rebase, and squash strategies. See references/merge-strategies.md for detailed comparison and examples.
Quick example:
git-flow config edit topic feature --upstream-strategy=rebase
Setup:
git-flow init --preset=classic --defaults
Workflow:
# Feature development
git-flow feature start user-auth
# ... commit, push, create PR ...
git-flow feature finish user-auth
# Release preparation
git-flow release start 1.3.0
# ... update version files, changelog ...
git-flow release finish 1.3.0
git push origin main develop --tags
# Production emergency
git-flow hotfix start 1.3.1
# ... fix bug ...
git-flow hotfix finish 1.3.1
git push origin main develop --tags
Setup:
git-flow init --preset=github --defaults
Workflow:
# Simpler than classic
git-flow feature start api-endpoint
git-flow feature finish api-endpoint
# Immediately deployable from main
git push origin main
Setup:
git-flow init --preset=gitlab --defaults
Workflow:
# Features as normal
git-flow feature start dashboard
git-flow feature finish dashboard
# Deploy to staging first
git-flow release start 2.0.0
git-flow release finish 2.0.0
# Merge to staging for testing
# Then promote to production
git-flow feature start new-feature
# ... work, commit ...
git push origin feature/new-feature
# Create PR, get reviews
git-flow feature finish new-feature
git fetch origin
git rebase origin/develop
# Fix conflicts if needed
git push origin feature/my-feature
git-flow overview
# Shows all active branches and their status
git-flow init --help
git-flow feature --help
git-flow config --help
git-flow -v feature start my-feature
# Shows detailed operation information
If git-flow command is not found:
references/installation.md)which git-flowbrew install gittower/tap/git-flow-nextIf merge/rebase conflicts occur:
git add . then run the git-flow command again with --continue flag--abort to cancel operationBranch prefixes: Customizable via --prefix option in git-flow init or git-flow config add topic
Merge strategies matter:
rebase for clean historysquash for simplified main branchmerge to preserve contributor historyConfiguration stored locally: Config stays in .git/config (checked into repo by default)
Presets provide starter templates:
Always version your releases: Tag with semantic versioning (v1.2.3) when finishing releases
Team coordination: Announce releases and hotfixes so team knows deployment timing
references/installation.md — Install and initialize git-flow-nextreferences/advanced-configuration.md — Custom workflows, multi-base branchesreferences/merge-strategies.md — Strategy comparison and examplesreferences/workflows.md — Detailed workflow examplesreferences/presets-and-configuration.md — Preset details and configuration options