Created
November 21, 2016 05:54
-
-
Save fujimura/9459e2c1fa0384a8a066dd6b38f175fd to your computer and use it in GitHub Desktop.
pre-push hook to prevent push to master branch
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
#!/bin/bash | |
# Taken from http://thinca.hatenablog.com/entry/20150306/1425639218 | |
while read local_ref local_sha1 remote_ref remote_sha1 | |
do | |
if [[ "${remote_ref##refs/heads/}" = "master" ]]; then | |
echo "Do not push to master branch!!!" | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment