Recall & Review
beginner
What is a Git hook?
A Git hook is a script that runs automatically at certain points in the Git workflow to automate tasks like checking code or sending notifications.
Click to reveal answer
beginner
Name two common types of Git hooks.
Pre-commit hook (runs before a commit is saved) and post-commit hook (runs after a commit is saved).
Click to reveal answer
beginner
How do Git hooks help automate workflows?
They run scripts automatically to check code quality, run tests, or update systems without manual steps, saving time and reducing errors.
Click to reveal answer
beginner
Where are Git hooks stored in a repository?
In the .git/hooks directory inside the Git repository.
Click to reveal answer
beginner
Can Git hooks prevent bad code from being committed?
Yes, pre-commit hooks can run checks and stop a commit if the code does not meet rules.
Click to reveal answer
What does a pre-commit Git hook do?
✗ Incorrect
Pre-commit hooks run before saving a commit to check or modify the code.
Where do you place Git hook scripts?
✗ Incorrect
Git hooks are stored in the .git/hooks directory inside the repository.
Which of these is NOT a benefit of Git hooks?
✗ Incorrect
Git hooks do not automatically merge branches.
What happens if a pre-commit hook script fails?
✗ Incorrect
If a pre-commit hook fails, it stops the commit to prevent bad code.
Which Git hook runs after a commit is made?
✗ Incorrect
The post-commit hook runs after a commit is made.
Explain how Git hooks help automate your coding workflow.
Think about tasks you do repeatedly before saving code.
You got /4 concepts.
Describe where Git hooks live and how you can use them to improve code quality.
Focus on location and purpose of hooks.
You got /4 concepts.