Created
August 4, 2016 17:11
-
-
Save jrlangford/36279a3ce37be120f509522da14db841 to your computer and use it in GitHub Desktop.
Git hook to reject pushes from branches which are not master
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/bash | |
while read oldrev newrev ref | |
do | |
if ! [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Error: Only \"master\" branch is accepted by this repository" | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment