A software house wants developers to catch leaked secrets and formatting errors before a commit ever leaves their laptop, and it wants the server to reject anything that bypasses that step. Which pairing is strongest?
Show answer and explanation
Answer: B
Local hooks give developers immediate feedback at commit time, catching secrets or style problems while the fix is cheapest. Hooks live on each machine and can be skipped, so server-side branch policies provide the authoritative enforcement point that blocks merges lacking required checks. Using both layers covers developers who forget or bypass hooks. A nightly scan finds problems only after they reach the branch, and training or late formatting does not provide reliable, automated prevention.
Why the other options are wrong
- A. A nightly scan operates after changes have already landed on the main branch, so secrets may already be exposed before anyone is alerted.
- C. Education without tooling depends on each person remembering the rules during every commit, so it cannot guarantee that problems are prevented.
- D. A release-manager formatting pass happens too late to catch issues at commit time, and it does not stop unformatted code from being merged earlier.