`pre-commit` `pre-commit`
`develop` `commit` `.git/hooks/pre-commit`
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
if [ "`git symbolic-ref HEAD | sed -e 's@^refs/heads/@@'`" = develop ]
then
echo "cannot commit on develop branch."
exit 1
fi
`git symbolic-ref HEAD` `HEAD` `develop` `exit 1`
* `commit`
1. `git commit`
2. `pre-commit`
3.
4. `prepare-commit-msg`
5.
6. `commit-msg`
7.
8. `post-commit`
* `merge`
1. `git merge`
2. `prepare-commit-msg`
3.
4. `post-merge`
`pre-commit` `git merge` `git commit`
`git commit --no-verify`
* Git
* Git hooks
* Git--Git-