Created
January 15, 2016 04:42
-
-
Save ms2sato/030df11fc9acd471a31b to your computer and use it in GitHub Desktop.
masterへのcommit、pushの禁止。以下のファイルをproject配下、 .git/hooks/ の中に入れる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# if the branch is master, then fail. | |
branch="$(git symbolic-ref HEAD 2>/dev/null)" || \ | |
"$(git describe --contains --all HEAD)" | |
if [ "${branch##refs/heads/}" = "master" ]; then | |
echo "Do not commit on the master branch!" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# if the branch is master, then fail. | |
branch="$(git symbolic-ref HEAD 2>/dev/null)" || \ | |
"$(git describe --contains --all HEAD)" | |
if [ "${branch##refs/heads/}" = "master" ]; then | |
echo "Do not commit on the master branch!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment