Mid From PDF Version Control Git & GitHub

What are hooks in Git?

Short answer: Can you give examples? Git hooks are scripts that run automatically when specific Git events occur (like committing or pushing). They live inside .git/hooks/. Common examples: pre-commit: Run linting or unit tests before a commit # .git/hooks/pre-commit npm run lint || exit 1 pre-push: Prevent pushes to main if [ "$(git rev-parse --abbrev-ref HEAD)" == "main" ]; then echo "You can't push directly to main!" exit 1 fi…

Explain a bit more

Example: In a team, we set a pre-commit hook to check code formatting with ESLint before any commit — ensuring consistency across all contributors.

Real-world example (ShopNest)

ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details