Validation examples with git hooks.
Well I guess you know that you will need git. :-)
By default .git folder is hidden.
If you use Visual Code then set this setting. That will enable the hidden git folder.
"files.exclude": {
"**/.git": false
}
You can also open your project in the terminal and run open .git/
- select a template from templates/
replace this with a validation from hooks/
# !!!!!!
# paste from hooks/*
# !!!!!!
cp templates/pre-commit ./.git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
If you want to know more about hooks read the git documentation
If you don't use zsh then you have to change the fist 2 lines from the template
#!/bin/zsh
source ~/.zshrc
replace with #!/bin/sh
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- David Hohl - Initial work - Fishme
See also the list of contributors who participated in this project.
This project is licensed under the GNU License - see the LICENSE.md file for details