Created
March 25, 2021 19:15
-
-
Save jtbonhomme/8bc3e05ef4dc1d5ff038518d6e342ecb to your computer and use it in GitHub Desktop.
This git hook prevents to push on remote any branch which matches with a regex (`DO-NOT-PUSH.*`)
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
# Save this into .git/hooks/pre-push, then chmod +x .git/hooks/pre-push | |
if [[ `grep 'DO-NOT-PUSH.*'` ]]; then | |
echo "You really don't want to push this branch. Aborting." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment