This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Choose the best response for each question.
Your development team works on Windows, macOS, and Linux computers. What is the best way to make sure Git hooks work the same on all platforms?
Use different hook scripts for each operating system.
Use #!/usr/bin/env bash at the start of hook scripts.
#!/usr/bin/env bash
Make all developers use the same operating system.
When creating pre-commit hooks to find passwords and secrets in code, which approach provides the best security coverage?
Only check for the word password in files.
Use pattern matching with regular expressions to find multiple types of credentials.
Only use manual code review to find credentials.
Your organization wants to make sure all commit messages follow the same standards across all development teams. Which Git hook is best for it?
Pre-commit.
Commit-msg.
Post-commit.
For teams with many developers, what is the recommended way to deploy and manage Git hooks?
Install hooks manually on each developer's computer.
Use version-controlled hooks with central deployment strategies.
Let each developer configure hooks individually.
Your pre-commit hooks are taking too long and slowing down the development workflow. Which optimization strategy would be most effective?
Remove all validation checks to improve speed.
Only process files that have changed.
Run all validation checks on every commit regardless of changes.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?