Git Flow Settings Scheme
All-in-one setting covering complete, flow, configuration, statusline. Includes structured workflows, validation checks, and reusable patterns for git.
Git Flow Settings Scheme
Complete Git Flow enforcement with branch naming, push protection, commit conventions, and real-time status display.
When to Use This Setting
Apply this setting when you need to:
- Enforce Git Flow branching strategy with automated branch naming validation and push protections
- Display real-time Git Flow status information including branch type, sync state, and merge targets
- Validate conventional commit messages and prevent direct pushes to main and develop branches Consider alternatives when:
- Your team uses trunk-based development or GitHub Flow where Git Flow conventions add unnecessary friction
- You are working on a solo project where branching strategy enforcement provides little value
Quick Start
Configuration
name: git-flow-settings-scheme type: setting category: git
Example Application
claude setting:apply git-flow-settings-scheme
Example Output
Setting applied. Changes:
- statusLine: Git Flow branch status monitor
- permissions.deny: [git push origin main, develop, --force, -f, reset --hard, rebase -i]
- permissions.allow: [git operations, flow commands, gh pr/issue, npm]
- hooks: [branch naming validator, conventional commits, push protection]
- env: GIT_FLOW_MAIN_BRANCH=main, GIT_FLOW_DEVELOP_BRANCH=develop
Core Concepts
Git Flow Branch Types Overview
| Aspect | Details |
|---|---|
| feature/* | New features branched from develop, merged back into develop via pull request |
| release/* | Release preparation branches following semver format like release/v1.2.0 |
| hotfix/* | Emergency fixes branched from main, merged into both main and develop |
| develop | Integration branch where features are combined and tested before release |
| main | Production branch containing only release-ready code |
Git Flow Enforcement Architecture
main ─────────────────────────── (protected)
| ^
| hotfix/*
| |
develop ──────────────────+── (protected)
| ^ ^
| feature/* release/*
| | |
+─────────+────────+
|
+------+--------+
| PreToolUse |
| Hooks: |
| - Branch name |
| validator |
| - Commit msg |
| checker |
| - Push guard |
+--------------+
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| GIT_FLOW_MAIN_BRANCH | string | "main" | Name of the production branch |
| GIT_FLOW_DEVELOP_BRANCH | string | "develop" | Name of the integration branch |
| GIT_FLOW_PREFIX_FEATURE | string | "feature/" | Prefix for feature branch names |
| GIT_FLOW_PREFIX_RELEASE | string | "release/" | Prefix for release branch names with semver format |
| GIT_FLOW_PREFIX_HOTFIX | string | "hotfix/" | Prefix for hotfix branch names |
Best Practices
- Start with feature branches for all new work - Even small changes benefit from the feature branch workflow. It creates a clean history and ensures every change goes through the pull request review process before reaching develop.
- Use semver strictly for release branches - The release branch validator enforces the pattern release/vMAJOR.MINOR.PATCH. Following semantic versioning consistently helps automate changelog generation and dependency management.
- Combine with CI integration - The Git Flow hooks enforce naming and commit conventions locally. Pair them with CI pipeline checks to ensure the same rules apply when commits are pushed from environments where Claude Code is not active.
- Review denied operations periodically - The deny list blocks force pushes and interactive rebases. If your workflow occasionally requires these operations, consider creating a separate profile for maintenance tasks with relaxed permissions.
- Monitor the statusline for context - The Git Flow statusline shows your current branch type, sync status, and merge target at a glance. Pay attention to the sync indicators to avoid working on stale branches.
Common Issues
- Branch creation rejected unexpectedly - The PreToolUse hook validates branch names when using git checkout -b. Ensure your branch name starts with feature/, release/, or hotfix/ followed by a descriptive name. Common mistakes include using feat/ or fix/ instead.
- Commit message format errors - Conventional commit format requires type(scope): description with a space after the colon. Verify your commit message matches patterns like feat:, fix:, docs:, etc. The validator provides examples when rejecting a message.
- Cannot push from main or develop - Direct pushes to protected branches are blocked by design. Create a feature branch first, push it, and create a pull request. If you need to push to these branches for administrative reasons, temporarily adjust the deny rules.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Project Standards Config
Claude Code settings preset that enforces consistent coding standards. Configures TypeScript strict mode, ESLint rules, Prettier formatting, and naming conventions.
Bedrock Configuration Blueprint
All-in-one setting covering configure, claude, code, amazon. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Corporate Preset
Production-ready setting that handles configure, proxy, settings, corporate. Includes structured workflows, validation checks, and reusable patterns for api.