Prevent Direct Push
Hooks git 484
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.
npx claude-code-templates@latest --hook git/prevent-direct-push claude-code — prevent-direct-push
Content
JSON
{
"description": "Prevent direct pushes to protected branches (main, develop). Blocks git push com..."
"hooks": {
"PreToolUse": [1 item]
}
}