Question: How would you configure Git to abort a commit if a smoke test script fails?

  1. Create a post-commit shell script that triggers the action.
  2. Create a post-commit hook to trigger the script.
  3. Create a pre-commit hook to trigger the script.
  4. Create a pre-commit shell script that triggers the action.

Answer: The correct answer of the above question is Option C:Create a pre-commit hook to trigger the script.