Skip to content

Instantly share code, notes, and snippets.

@code2exe
Forked from SimonHoiberg/prepush-hook
Created July 30, 2020 06:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code2exe/bc1519c0f09dd7d108ebb74b36580188 to your computer and use it in GitHub Desktop.
Save code2exe/bc1519c0f09dd7d108ebb74b36580188 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