0
0
Gitdevops~5 mins

Sharing hooks with the team (husky) in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Husky in the context of Git?
Husky is a tool that helps you run scripts automatically before Git actions like commit or push. It makes sure everyone on the team runs the same checks.
Click to reveal answer
beginner
How does Husky help share Git hooks with a team?
Husky stores hook scripts in the project configuration, so when team members clone the repo and install dependencies, the hooks are set up automatically on their machines.
Click to reveal answer
intermediate
Where do you define Husky hooks in a project?
You define Husky hooks in the package.json file under the "husky" section or in separate hook files managed by Husky in the .husky directory.
Click to reveal answer
beginner
What command do you run to install Husky hooks after cloning a repo?
You run `npm install` or `yarn install` to install dependencies, and Husky will automatically set up the Git hooks defined in the project.
Click to reveal answer
beginner
Why is sharing Git hooks with Husky better than manually setting hooks?
Because Husky automates hook setup, it avoids mistakes and ensures all team members use the same checks without extra manual steps.
Click to reveal answer
What does Husky primarily help with in Git?
ARunning scripts automatically before Git actions
BMerging branches automatically
CCreating new Git repositories
DBacking up Git data
Where are Husky hooks usually defined?
AIn the package.json or .husky directory
BIn the .gitignore file
CIn the README.md file
DIn the node_modules folder
How do team members get Husky hooks after cloning a repo?
ABy manually copying hook files
BBy running npm install or yarn install
CBy running git init
DBy creating hooks themselves
Which Git action can Husky run scripts before?
Abranch
Bclone
Cfetch
Dcommit
What is a key benefit of using Husky for Git hooks?
AAutomatically merges conflicts
BIncreases Git repository size
CEnsures consistent hooks for all team members
DRemoves the need for Git
Explain how Husky helps share Git hooks with your team.
Think about how Husky makes sure everyone runs the same checks without manual setup.
You got /4 concepts.
    Describe the steps a team member takes to get Husky hooks after cloning a repository.
    Focus on what happens after cloning and installing dependencies.
    You got /4 concepts.