Git hooks are a useful mechanism for performing code quality checks in your local development environment before committing that code or pushing it up to a remote branch. A common quality check that a git hook can perform is running the project’s code linter, such as eslint.
While it can be good practice to have these hooks configured within a project, at times they can be annoying when you’re trying to share a work-in-progress branch with a team mate by pushing the changes to a remote branch. In such situations, they can feel like they’re an impediment towards getting meaningful work done.
A workaround to this (until you’re able to come back and address those issues), is the
--no-verify flag, which bypasses these hooks.
It’s worth noting that because the use of
--no-verify is not able to be suppressed entirely (as far as I’m aware), it’s good practice to have the same checks that are performed by the git hooks also be performed as part of a continuous integration/continous delivery pipeline. Doing so will guarantee that code violating quality checks run by configured git hooks are always (eventually) addressed.