Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 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 ]
echo "------------------- ERROR ------------------------"
echo "Both your Gemfile and your Gemfile.lock must be committed"
echo "------------------ END ERROR ---------------------"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment