Need a customized project? We build it to your exact requirements.Contact us on WhatsApp

Prevent Direct Push

Hook git 16 lines

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.

prevent-direct-push.jsonPreview
{
  "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", …

You are seeing the first 50 words. Purchase the Claude Skills Pack to see the full hook and download it.

Buy the pack · $19.98

More in git