Git hooks live into .git/hooks folder in every git repo.
The name of each one tells us when the git hook it's gonna be executed, and the .sample extension in each one prevent its execution.
When we are going to execute a script in some part of git's lifecycle, we need to
- Find the file of the part of lifecycle that we need to override
- Remove the .sample extension for this file
- Write our own code to this file
In the pre-push example we've override the .git/hooks/pre-push file, and write an example to intercept the push with a confirmation message