Skip to content

Instantly share code, notes, and snippets.

@nyarly
Created March 15, 2019 03:59
Show Gist options
  • Select an option

  • Save nyarly/ae0ff51324b36509cb6ba8a5b4d3da25 to your computer and use it in GitHub Desktop.

Select an option

Save nyarly/ae0ff51324b36509cb6ba8a5b4d3da25 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "$(git config --get branch.master.foolhardy)" = 'true' ]; then
exit 0
fi
while read local lsha remote rsha; do
case $remote in
**/master)
echo 'Refusing to push to master!'
echo " If it's that kind of joint:"
echo " 'git config --type bool branch.master.foolhardy true'"
exit 1 ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment