Skip to content

Instantly share code, notes, and snippets.

@oh-sky oh-sky/pre-commit
Created Sep 9, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.