Skip to content

Instantly share code, notes, and snippets.

@kidd
Created February 7, 2019 13:16
# alternative to https://gist.github.com/SkyM/1641459
FORBIDDEN=$(echo 'declaim break ==== >>>> <<<< string.gmatch inspect' |
sed -e 's/ /\\\|/g')
git diff --cached | grep '^+' | sed -e 's/--.*//' |
grep -n $FORBIDDEN &&
echo "COMMIT REJECTED Found '$FORBIDDEN' references. Please remove them before commiting" &&
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment