Created
April 22, 2013 18:38
-
-
Save svachalek/5437407 to your computer and use it in GitHub Desktop.
pre-commit hook to prevent commit on detached head
This file contains 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
#!/bin/sh | |
if ! git symbolic-ref HEAD &> /dev/null; then | |
echo "You are in a detached head state! Commit has been blocked. (Use --no-verify to bypass this check.)" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment