Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove remote git hooks?

I have pre-push hook implemented with Husky. Now I wanna remove it.

Problem is that after yarn remove husky git hooks are still there inside .git/hooks.

Because of that I get this error every time I want to commit or switch branch or commit, thus commiting is not even possible -->

.git/hooks/pre-commit: line 6: node_modules/run-node/run-node: No such file or directory

I know I can always delete every hook inside .git/hooks but how I can push this changes remotely? How not to force my teammates do the same thing?

Also I know I can commit using -n flag but still I would like not to do it.

like image 514
Nikola Mitic Avatar asked Aug 30 '18 11:08

Nikola Mitic


People also ask

How do I remove pre received hooks?

Next to the pre-receive hook that you want to configure, click the Hook permissions drop-down menu. Select whether to enable or disable the pre-receive hook, or allow it to be configured by the repository administrators.

How do I disable Precommit hooks?

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.

How do I disable my husky?

Double-click on Windows Firewall → Protect all network connections → set to Disabled and press Apply.

How do you stop a hook?

Go to Auth0 Dashboard > Auth Pipeline > Hooks and locate the extensibility point for which you want to enable or disable a Hook. Click on the dropdown box located immediately under the extensibility point's name and description.


1 Answers

Assuming you have no non-husky hooks, you might want to keep:

rm -f .git/hooks/* 

every file inside ".git/hooks/" is either a git-hook or ignored by git. By removing everything inside, you'll get rid of all hooks, and restore the default behavior.

By default there are example-hooks in there, but except for being examples they serve no purpose, so you can delete them.

like image 121
wotanii Avatar answered Sep 30 '22 18:09

wotanii