Last active
November 7, 2017 15:12
-
-
Save casmith/aa811d0fa94d2d310b5f84b06090c288 to your computer and use it in GitHub Desktop.
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 | |
if test $(git rev-parse --abbrev-ref HEAD) = "master" ; then | |
echo "Cannot commit on master" | |
exit 1 | |
fi | |
if test $(git rev-parse --abbrev-ref HEAD) = "develop" ; then | |
echo "Cannot commit on develop" | |
exit 1 | |
fi | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [[ $BRANCH == release* ]]; then | |
echo "Cannot commit on a release branch" | |
exit 1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment