Make usage of git hooks easy in project of any programming language and any platform. Works on Windows with git bash.
Language | Install | Command Execution |
---|---|---|
Node | npm install git-hooks-wrapper |
npx git-hooks-wrapper |
Python | TBD pypi pip | |
PHP | TBD Composer PEAR Packagist | |
... |
After install automatically runs init
wrapping $PWD/git-hooks
folder by default. Folder can be changed by running pattern
$ $ghw init $hooksDirecotory
This project uses itself so use ./git-hooks as examples
In addition to init and hooks there are several useful scripts in ./utils that can be run with pattern
$ $ghw $command $@
Removes untracked files and recovers them afterwards - ensures that test are running without side-effects. If files was changed (untracked appeared) exists with error.
$ $ghw
# SCRIPTS:
- init
- test
# HOOKS:
- applypatch-msg
- commit-msg
- fsmonitor-watchman
- p4-pre-submit
- post-applypatch
- post-checkout
- post-commit
- post-index-change
- post-merge
- post-receive
- post-rewrite
- post-update
- pre-applypatch
- pre-auto-gc
- pre-commit
- pre-merge-commit
- prepare-commit-msg
- pre-push
- pre-rebase
- pre-receive
- push-to-checkout
- sendemail-validate
- update
# UTILS:
- forceupdate
- forceupdate_submodules
- getbranch
- getRefsBranch
- getRemote
- semver_inc
- stash_untracked
- stats
Add argument with stats overview
Add arguments with message uniqueness and open issue existence
https://git-scm.com/docs/githooks
https://www.atlassian.com/git/tutorials/git-hooks
https://codeinthehole.com/tips/tips-for-using-a-git-pre-commit-hook/