Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akira-kuriyama/39554efe88ca4b4e7a0b4103b469bdaf to your computer and use it in GitHub Desktop.
Save akira-kuriyama/39554efe88ca4b4e7a0b4103b469bdaf to your computer and use it in GitHub Desktop.
% cat .git/hooks/pre-commit
#!/bin/sh
branch=$(git symbolic-ref --short HEAD)
if test "$branch" = "master"
then
cat <<\EOF
masterへのコミット禁止!!!!!
EOF
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment