🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Git Config, .gitignore and Hooks: all 10 questions

Quiz: Git Config, .gitignore and Hooks · Question 9 of 10

A pre-commit hook script ends with exit 1. What happens?

A pre-commit hook script ends with exit 1. What happens?

  1. A.The commit is created and a warning is shown
  2. B.The commit is stopped
  3. C.The commit is pushed automatically
  4. D.Git deletes the staged changes
Answer & explanation

Correct answer: The commit is stopped

A non-zero exit code from pre-commit aborts the commit.

Can you get the rest right without peeking?

Take the timed Quiz: Git Config, .gitignore and Hooks quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →