Skip to content

Instantly share code, notes, and snippets.

@oh-sky
Created September 9, 2015 15:04
Show Gist options
  • Save oh-sky/2c3b6cdfa8b941f585e1 to your computer and use it in GitHub Desktop.
Save oh-sky/2c3b6cdfa8b941f585e1 to your computer and use it in GitHub Desktop.
masterブランチへのコミットを禁止するgit-hook
#!/bin/sh
BRANCH=`git rev-parse --abbrev-ref HEAD`
if test $BRANCH = 'master'; then
echo 'Commiting to master is forbidden.'
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment