← 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?
- A.The commit is created and a warning is shown
- B.The commit is stopped
- C.The commit is pushed automatically
- 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 →