Created
May 1, 2016 04:14
-
-
Save mozillazg/b26a74f716ed5e786fe186fe64b8360c to your computer and use it in GitHub Desktop.
protect 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
protect_branch() { | |
protected_name=$1 | |
current_name=$(git symbolic-ref HEAD | sed -e "s/^refs\/heads\///") | |
if [ "$current_name" = "$protected_name" ]; then | |
echo "!!! OH NO! you are trying to change the **$protected_name** branch!!!" | |
exit 1 | |
fi | |
} | |
protect_branch master |
Author
mozillazg
commented
May 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment