I have this code below in my Github Repository, i want to prevent anyone in my repo from committing directly to master, but it isnt working, what a, i doping wrong?
I have searched through stack overflow and youtube trying to find tutorials for this issue and i havent had any luck
9 lines (6 sloc) 154 Bytes
#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ]; then
echo "You can't commit directly to master branch"
exit 1
fi
I want users to be blocked from committing directly to master Currently they are able to commit to master
My script is definitely execute-able, but still it doesnt display anything