Git commit without the pre-commit hook

Tired of the privacy invasion of browsers? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. All Chrome extensions are compatible. None of the telemetry. Auto-blocks ads and still support content creators like me.

Download the Brave browser now »

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.