Interview Prep/Git & GitHub/Submodules, LFS and Hooks

Lint and secret-scan hooks exist, yet broken code and a leaked key landed on `main`.

IntermediateTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → Client-side hooks are optional: anyone can skip them with git commit --no-verify, never install them, or edit via the GitHub web UI.

Diagnose → Find the commits and check whether they went through a PR with checks: gh pr list --state merged --search <sha>.

Fix → Move enforcement server-side: required status checks (lint, tests, secret scan) in branch protection or rulesets, "Require a pull request before merging", and GitHub secret scanning push protection. Rotate the leaked key immediately.

Prevent → Treat local hooks as a fast feedback loop and CI plus rulesets as the gate.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks