Hooks Examples
Chester Wyke December 20, 2023 Updated: April 26, 2025 #GitSkip commit hooks
Source: https://stackoverflow.com/questions/7230820/skip-git-commit-hooks
Add a --no-verify flag. Only tested on commit as below
git commit --no-verifypre-commit Hook to prevent changes to a zola project base_url
#!/bin/sh
# Check if we see the line with the base_url being changed
git diff --cached config.toml | grep "^-base_url"
if [ $? -eq 0 ]
then
echo "Error: Change detected to base_url"
exit 1
fizola_chrono pre-push hook
Conventional Commit Checking
Simple (not robust) conventional commit checker. Instead of copying code here that may go out of date here is a link to one I have in use in a project. In that same folder are scripts to set it up if you don’t already know how to do it. If you are still running into issues please reach out via github issues (see link in footer).