Skip to content

Bypassing Git Hooks

Erica Pisani
Erica Pisani
1 min read

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.


📫
Enjoy this post? Subscribe to be notified when I publish new content!
tips-and-tricks

Comments


Related Posts

Members Public

Git Log's Hidden Gems: Using -S and -L for Powerful Code History Search

Ever needed to track down when a specific piece of code was first introduced in a project? As part of some refactoring I had to do recently, I needed to do just that for a variable on a Django model. I was already familiar with the basic git log command,

Git Log's Hidden Gems: Using -S and -L for Powerful Code History Search
Members Public

Using XOR to write concise conditionals

It's not uncommon that I sometimes write if statements where the overall conditional is true when both conditions are true or both are false. As an example, let's say I'm validating input from an API call where I'm updating information on a

Members Public

Fixing "No preset version installed for command poetry"

Poetry is a packaging and dependency management tool for Python, and a tool that didn't exist when I worked with Python many years before I started working at Float. I also hadn't been exposed to asdf, which is a handy little tool for managing multiple runtimes.