Created
September 22, 2016 21:45
-
-
Save bdlangton/a03686bbe0387f5b2539350bd3a3c453 to your computer and use it in GitHub Desktop.
Clears out current git hooks and runs 'git init' to apply hooks that are in .git-templates/hooks
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 | |
# Check that the git directory exists. | |
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) | |
if [ -z "$GIT_DIR" ]; then | |
echo >&2 "Fatal: GIT_DIR not set" | |
exit 1 | |
fi | |
# Remove existing hooks and re-init to copy new hooks. | |
rm $GIT_DIR/hooks/* | |
git init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment