Artificial intelligent assistant

Git のフックスクリプトで、単なる commit か merge commit かを区別出来るのか? `commit` `merge commit` Gitflow `develop` `commit` `feature` `release` `merge commit` `pre-commit` `commit` `merge --no-ff` `merge commit` (hook scripts) `pre-commit`

`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-

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 26d2596d1be94200fd424300ed51b118