Last active
July 5, 2017 15:33
-
-
Save KMontag42/9ed35e27554a428f6c4abb082efc4e1f to your computer and use it in GitHub Desktop.
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 | |
# To enable this hook, rename this file to "pre-commit" and add it to .git/hooks/ | |
# of C/P the following block in your existing .git/hooks/pre-commit | |
#IMPORTANT - for the hook to be active run: | |
# chmod +x .git/hooks/pre-commit | |
if [ `git diff --cached --name-only | grep -o Gemfile | wc -l` -eq 1 ] | |
then | |
echo "------------------- ERROR ------------------------" | |
echo "Both your Gemfile and your Gemfile.lock must be committed" | |
echo "------------------ END ERROR ---------------------" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment