Skip to content

Instantly share code, notes, and snippets.

@SimonHoiberg
Created July 26, 2020 08:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save SimonHoiberg/589d68cface0b21ef2a502a029975f5a to your computer and use it in GitHub Desktop.
Save SimonHoiberg/589d68cface0b21ef2a502a029975f5a to your computer and use it in GitHub Desktop.
#!/bin/sh
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ 'master' = ${current_branch} ]
then
echo "ERROR: Not allowed to push to master."
exit 1;
else
exit 0;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment