Git AdvancedLesson 47Free preview
Git Hooks
This lesson is part of Git · All levels
Summary
Git hooks are scripts that are executed automatically on specific events such as commit, merge, and push. The client-side hook is in the .git/hooks folder, for example pre-commit to run the linter before commit. A server-side hook such as pre-receive can reject push that violates team rules.
Key points
- Hook is an automated script on a particular Git event
- The client hook is stored in the .git/hooks folder
- Pre-commit useful running the linter and test before commit
- Server hooks such as pre-receive and post-receive set push
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.