Create a file .husky/helpers/prevent_pushing_to_master.sh
and add the following contents:
#!/bin/sh
prevent_pushing_to_master() {
current_branch=`git symbolic-ref HEAD`
current_origin=`git remote`
if [ current_origin = "origin" -o "$current_branch" = "refs/heads/master" -o "$current_branch" = "refs/heads/master" ]
then
cat <<EOT