G

Git Flow Settings Scheme

All-in-one setting covering complete, flow, configuration, statusline. Includes structured workflows, validation checks, and reusable patterns for git.

SettingClipticsgitv1.0.0MIT
0 views0 copies

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

AspectDetails
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
developIntegration branch where features are combined and tested before release
mainProduction 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

ParameterTypeDefaultDescription
GIT_FLOW_MAIN_BRANCHstring"main"Name of the production branch
GIT_FLOW_DEVELOP_BRANCHstring"develop"Name of the integration branch
GIT_FLOW_PREFIX_FEATUREstring"feature/"Prefix for feature branch names
GIT_FLOW_PREFIX_RELEASEstring"release/"Prefix for release branch names with semver format
GIT_FLOW_PREFIX_HOTFIXstring"hotfix/"Prefix for hotfix branch names

Best Practices

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

  1. 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.
  2. 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.
  3. 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.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates