This is a series of GIT Hooks for your NPM project.
prepare-commit-msg
- avoids you to commit to the branches:
master
,dev
,develop
,staging
,release
- add your ticket number to the beginning of the commit message
- friendly remind you if you're not following the proper branch naming strategy
pre-push
- runs
npm run lint
andnpm run test
, if they exist on your NPM project folder
To make it work, there are 2 requirements:
- Install Python 2
- Setup Git Hooks
Read carefully the next sections to get started.
Download page: https://www.python.org/downloads/release/python-2716/
For Windows: https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi
For MacOS: https://www.python.org/ftp/python/2.7.16/python-2.7.16-macosx10.9.pkg
Run:
git config --global core.hooksPath $PWD
# or
./install.sh
You must problably not need to override these hooks, but if for some reason you need, follow below instructions
To override the hooks from this repository, run the following command in the root folder of the desired repository:
# From your git project folder
git config core.hooksPath '.git/hooks'
To restore the usage of the global hooks:
# From your git project folder
git config --unset core.hooksPath
Run below command to remove the global GIT configuration
git config --global --unset core.hooksPath