A

Allow Git Polished

Production-ready setting that handles allow, common, operations, version. Includes structured workflows, validation checks, and reusable patterns for permissions.

SettingClipticspermissionsv1.0.0MIT
0 views0 copies

Allow Git Polished

Pre-approve common git operations to eliminate repetitive permission prompts during version control workflows.

When to Use This Setting

Apply this setting when you need to:

  • Streamline your git workflow by allowing Claude Code to execute common version control commands without prompts
  • Maintain a productive development pace without being interrupted by permission dialogs for safe operations
  • Define explicit boundaries for git operations, permitting standard commands while keeping destructive ones gated Consider alternatives when:
  • You prefer to review and approve every git command before execution for maximum oversight
  • Your team requires all git operations to go through a custom approval workflow

Quick Start

Configuration

name: allow-git-polished type: setting category: permissions

Example Application

claude setting:apply allow-git-polished

Example Output

Setting applied. Changes:
- permissions.allow: [git status, git diff, git add, git commit, git push, git pull, git log]

Core Concepts

Git Permission Model Overview

AspectDetails
Allowed Operationsstatus, diff, add, commit, push, pull, and log are pre-approved
Wildcard PatternsThe :* suffix allows these commands with any arguments and flags
Unlisted OperationsGit commands not in the allow list still require interactive approval
Security BoundaryDestructive operations like force push and hard reset remain gated

Permission Resolution Architecture

+---------------------------+
|  Claude Code wants to     |
|  run a git command        |
+---------------------------+
         |
         v
+---------------------------+
|  Check Allow List         |
+---------------------------+
|  git status    -> ALLOW   |
|  git diff:*    -> ALLOW   |
|  git add:*     -> ALLOW   |
|  git commit:*  -> ALLOW   |
|  git push:*    -> ALLOW   |
|  git pull:*    -> ALLOW   |
|  git log:*     -> ALLOW   |
+---------------------------+
         |
    match / no match
         |         |
         v         v
     Execute    Prompt
     directly   user for
                approval

Configuration

ParameterTypeDefaultDescription
permissions.allowarray[]List of allowed git command patterns with optional wildcard arguments
Bash(git status)stringN/AAllow git status without any arguments
Bash(git diff:*)stringN/AAllow git diff with any arguments including file paths and flags
Bash(git commit:*)stringN/AAllow git commit with any message and flags
Bash(git push:*)stringN/AAllow git push to any remote and branch

Best Practices

  1. Start with read-only git operations - Allow git status, diff, and log first. These are completely safe and eliminating prompts for them provides immediate productivity gains without any risk.
  2. Add write operations incrementally - After gaining confidence with read-only auto-approvals, add git add, commit, push, and pull. Monitor the first few sessions to ensure appropriate usage.
  3. Pair with deny rules for dangerous operations - While unlisted operations require manual approval by default, explicitly denying git push --force and git reset --hard adds an extra safety layer.
  4. Consider branch-specific push rules - Instead of allowing all git push operations, you can restrict pushes to specific branch patterns like git push origin feature/* for additional safety.
  5. Review git history after sessions - Periodically review the git log after Claude Code sessions to verify that automated commits and pushes meet your quality standards.

Common Issues

  1. Permission still prompted for listed commands - Verify that the command pattern matches exactly. The pattern Bash(git diff:) matches git diff with arguments but Bash(git diff) without : only matches the exact command with no arguments.
  2. Unexpected push to wrong branch - The Bash(git push:) pattern allows pushing to any branch. If you want to restrict push targets, use more specific patterns like Bash(git push origin feature/:*).
  3. Commit messages not reviewed - When git commit is auto-allowed, Claude Code will commit with its generated message without prompting. If you want to review commit messages, remove git commit from the allow list.
Community

Reviews

Write a review

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

Similar Templates