Lesson Completion
Back to course

Skipping Hooks Safely

Beginner
6 minutes4.7Git

The Hook (The "Byte-Sized" Intro)

--no-verify is an emergency exit, not the main door. Yes, sometimes you need to skip hooks — you're fixing a CI issue and need to push a one-line change immediately. But if you're using --no-verify on every commit, your hooks are either too slow, too strict, or checking the wrong things. Fix the hooks, not the habit.

📖 What is Skipping Hooks Safely?

Using --no-verify to bypass client-side hooks when necessary, while understanding the risks and maintaining accountability.

Conceptual Clarity

What --no-verify skips:

CommandHooks Skipped
git commit --no-verifypre-commit, commit-msg
git push --no-verifypre-push
git merge --no-verifypre-merge-commit

What --no-verify does NOT skip:

Hook TypeCan Be Skipped?
Client-side hooks✅ with --no-verify
Server-side hooks❌ Never
CI/CD checks❌ Never
Branch protection rules❌ Never

Real-Life Analogy

--no-verify is like the emergency override on a fire door. It's there for real emergencies — but if you're using it every day, you have a bigger problem to fix.

Visual Architecture

flowchart TD COMMIT["git commit"] --> HOOKS{"Hooks enabled?"} HOOKS -->|"Normal"| PRECOMMIT["🔍 pre-commit runs"] HOOKS -->|"--no-verify"| SKIP["⏭️ Hooks skipped"] SKIP --> RISK["⚠️ No local checks"] PRECOMMIT --> SAFE["✅ Checked"] style SKIP fill:#2d1b1b,stroke:#e94560,color:#e94560 style SAFE fill:#1b2d1b,stroke:#53d8fb,color:#53d8fb

Why It Matters

  • Legitimate uses: Emergency fixes, documentation-only changes, WIP commits.
  • Risks: Bypasses all client-side quality checks.
  • Safety net: Server-side hooks and CI still catch issues.
  • Culture signal: Frequent --no-verify means hooks need improvement.

Code

bash
# ─── Skip hooks (legitimate reasons) ─── git commit --no-verify -m "emergency: fix production crash" git push --no-verify # ─── Don't make it a habit ─── # If you skip frequently, fix the hook instead: # - Too slow? → Use lint-staged (check only staged files) # - Flaky? → Remove unreliable checks # - Too strict? → Move heavy checks to pre-push or CI # ─── Alternative: skip specific checks ─── # Instead of --no-verify, some tools support partial skip: SKIP=lint git commit # Husky/pre-commit support # ─── Track who skips hooks (team visibility) ─── # CI will catch what hooks missed # PR reviews show if checks were skipped

Key Takeaways

  • --no-verify skips client-side hooks only — CI and server hooks still run.
  • Use it for emergencies, not as a daily habit.
  • If you skip frequently, fix the hooks (too slow, too strict, flaky).
  • Server-side hooks and CI are the ultimate safety net.

Interview Prep

  • Q: What does --no-verify do? A: It skips client-side hooks (pre-commit, commit-msg, pre-push). It does NOT bypass server-side hooks, CI/CD pipelines, or branch protection rules.

  • Q: When is it appropriate to skip hooks? A: Emergency production fixes, documentation-only changes, or WIP commits that will be squashed before merge. It should be rare — if you skip regularly, the hooks need to be improved.

  • Q: What should you do if team members frequently skip hooks? A: Investigate why — hooks are probably too slow, too strict, or unreliable. Fix the root cause: use lint-staged to speed up, remove flaky checks, move heavy validations to CI.

Topics Covered

Git HooksWorkflow

Tags

#git#hooks#no-verify#workflow

Last Updated

2026-02-13