Getting to know pre-commit - zerokspot.com
The core idea is that you have all your hooks configured within the project's root directory in a file called .pre-commit-config.yaml
and then simply execute pre-commit install
once to have pre-commit inject itself into .git/hooks/pre-commit
. From now on, whenever you are about to make a commit, pre-commit will launch and execute your hook scripts if appropriate.
The scripts themselves are hosted in some other repository that you specify in that config file. To illustrate this, here a short example:
- repo: ssh://git@our-repo-server.com/precommit-hooks.git sha: 1bf3eaef56059e168aac55393a7494cac727ebcd hooks: - id: flow-branches - id: grunt-test
Read full article from Getting to know pre-commit - zerokspot.com
No comments:
Post a Comment