I had set up a git hook in pre-commit file to run git pull
before any commit. Now I have deleted that file and restarted my computer multiple times, but that hook is still running before my commits.
How can I remove or disable that completely?
Use the --no-verify option to skip git commit hooks, e.g. git commit -m "commit message" --no-verify . When the --no-verify option is used, the pre-commit and commit-msg hooks are bypassed.
Deleting pre-receive hooksUnder " Settings", click Hooks. Next to the pre-receive hook that you want to delete, click .
Quick tip if you want to skip the pre-commit validations and quickly want to get a commit out there. To get your commit through without running that pre-commit hook, use the --no-verify option. Voila, without pre-commit hooks running!
You can set HUSKY environment variable to 0 in your CI config file, to disable hooks installation.
I figured out what was causing that:
I had created my pre-commit
hook in git core directory, but the git had created a pre-commit hook in project's .git/hooks/
directory. I just removed it.
Based on the documentation, git hooks should reside in $GIT_DIR/hooks/
- verify this dir does not contain the pre-commit
hook file
If the problem persists, you could flag your git commit
with --no-verify
(that should bypass the pre-commit hook)
Information can be found at:
https://git-scm.com/docs/githooks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With