Created
February 12, 2018 11:48
-
-
Save sandfox/10bcd8286f46f253201ae8bd151a2d95 to your computer and use it in GitHub Desktop.
delete all hooks from a git repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -e | |
shopt -s extglob | |
HOOKDIR="$(git rev-parse --git-dir)/hooks" | |
if [ -d "$HOOKDIR" ]; then | |
rm -rf "${HOOKDIR:?}"/!(*.sample) | |
echo "all hooks removed from $HOOKDIR" | |
else | |
echo "no git hooks folder found, you probably aren't in a git repo" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment