Git commit without the pre-commit hook

Tired of the privacy invasion of the Chrome webbrowser? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. It supports all the same Chrome extensions, with none of the telemetry. It auto-blocks ads and helps support content creators like me.

Give the Brave browser a try »

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.