How to remove remote git hooks? How to remove remote git hooks? git git

How to remove remote git hooks?


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.


I think it's better to keep all *.sample in .git/hooks

To remove git hooks who come husky :

  • First, go to hooks directory
cd .git/hooks
  • Secondly, keep all *.sample files and remove others
ls | grep \.sample -v | xargs rm


So basically removing remote git hooks is not possible.

The best you can do is to remove your local ones and notify the rest of the team to do the same.

On how to remove git hook locally check @wotanii answer.