Created
May 28, 2020 18:02
-
-
Save StephenVinouze/20bb168ce7eb3966cd3e288eb41215e8 to your computer and use it in GitHub Desktop.
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/sh | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
REGEX="^(develop|master|release|((feature|bigfeature|task|bugfix|hotfix)\/[A-Z]+-[0-9]+_[A-Z]+_.+))$" | |
if ! [[ $BRANCH =~ $REGEX ]]; then | |
echo "Your commit was rejected due to branching name" | |
echo "Please rename your branch with $REGEX syntax" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment