Git commit without the pre-commit hook

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, June 29, 2020

Follow me on Twitter as @mattiasgeniar

Quick tip if you want to skip the pre-commit validations and quickly want to get a commit out there.

$  git commit . -m 'quick fix'
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Flake8...................................................................Failed
- hook id: flake8
- exit code: 1

core/utils/estimate.py:7:9: E126 continuation line over-indented for hanging indent
core/utils/estimate.py:7:9: E265 block comment should start with '# '

To get your commit through without running that pre-commit hook, use the --no-verify option.

$ git commit . -m 'quick fix' --no-verify
[master 81d0b2e0] wip
 19 files changed, 1718 insertions(+), 5 deletions(-)

Voila, without pre-commit hooks running!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.