Last active
November 13, 2022 22:27
-
-
Save Sonare/b589092542340e620efc32d98fe3d3d5 to your computer and use it in GitHub Desktop.
forbid commiting into master branch
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 | |
# | |
git rev-parse --abbrev-ref HEAD | grep -v -E "^master$" > /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Current Branch is master" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment