Prevent Direct Push

Hookhook5091Verified

Prevent direct pushes to protected branches (main, develop). Blocks git push commands targeting main or develop branches to enforce Git Flow workflow. Requires using feature release hotfix branches and pull requests instead of direct commits to protected branches.

Install CommandLocked
npx claude-code-templates@latest --skill ••••••••••••••••••••
Unlock to reveal command
ByCommunity
claude-code — hooks git prevent direct push
$

Interactive Terminal Locked

Unlock this skill to run and inspect the interactive installation sequence.

CookApps Fine Software Cuisine
CONTENT

{

"description": "Prevent direct pushes to protected branches (main, develop). Blocks git push commands targeting main or develop branches to enforce Git Flow workflow. Requires using feature/release/hotfix branches and pull requests instead of direct commits to protected branches.",

"hooks": {

"PreToolUse": [

{

"matcher": "Bash",

"hooks": [

{

"type": "command",

"command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/prevent-direct-push.py"

}

]

}

]

}

}

How to Use & Getting Started

Protected

# Step 1: Initialize skill agent setup

npx skills add Prevent Direct Push --install-production

python -m pip install -r requirements.txt

codex plugin install Prevent Direct Push@latest

export API_KEY=secret_token_key_here

Installation Runbook & Walkthrough Locked

Unlock this skill to reveal complete step-by-step setup guides, terminal commands, configuration recipes, repository links, and interactive installation video walkthroughs.

Unlock full access to Prevent Direct Push

Get instant access to complete setup guides, repository source code, and integration assets.