Git hooks
Hooks are scripts run by Git. Git will run hook scripts based on the situation or the stage of deployment. There are several hooks that are run at different stages of the deployment of code. We are interested in the pre-commit hook—this hook is run before a commit is committed to the repository. There are several good examples for pre-commit hooks available. The Puppet Labs suggested hook runs puppet parser validate against all the files ending in the .pp extension. The script can be found at http://projects.puppetlabs.com/projects/1/wiki/puppet_version_control, the website of Puppet Labs. Copy the script from the page into the .git/hooks directory of your Git repository. The file should be named pre-commit and have the executable permissions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access