Provides Git hook enforcing commit message.
- first line length must be less than 50 characters.
- if applicable, second line may be empty.
- length of every lines may be less than 72 characters.
Install git 2.9 or higher. Run the commands below:
cd /path/to/all/your/gists
git clone [email protected]:0bf6ef017e1e738b344e.git
git config --global core.hooksPath $PWD
In terminal:
- Go to a Git repository root:
cd /path/to/my/git/repository
- Run the following command:
curl -s https://gist.githubusercontent.com/tristan0x/0bf6ef017e1e738b344e/raw/d71a6a0eb2cbebe2842fda86259593824110dda6/setup-commit-msg-hook | sh -e -
$ git init /tmp/foo
$ cd /tmp/foo
$ curl -s https://gist.githubusercontent.com/tristan0x/0bf6ef017e1e738b344e/raw/d71a6a0eb2cbebe2842fda86259593824110dda6/setup-commit-msg-hook | sh -e -
# adding git/hooks/commit-msg
# adding git/hooks/validate-commit.py
$
You can add an alias in your shell configuration file:
alias git-setup-cogniteev-hook='curl -s https://gist.githubusercontent.com/tristan0x/0bf6ef017e1e738b344e/raw/d71a6a0eb2cbebe2842fda86259593824110dda6/setup-commit-msg-hook | sh -e -'