Git hooks make for a great help in OSS maintenance and are a very practical and useful tool that a lot of organisations in the software industry can benefit from adopting but I feel there's a lack a conversation or a lack of exposure around them.
This workshop will cover how git handles hooks internally (alongwith an overview of git internals), how to write your own hooks, the pre-commit framework, a bingo of common problems you might face setting up your own hooks or sharing them and demonstrations of how I've adopted pre-commit hooks in professional settings as well as fun experiments I've done on my own personal workflows (meta-hooks, fun TUI updates).
Introduction to git hooks
What git hooks are and why they matter
Local vs. server-side hooks (brief overview, focus on local)
Real-world examples of hooks in action
Going over Git internals relevant to hooks: how Git executes them, what chaining/limitations exist.
Exploring built-in hooks
Tour of the .git/hooks
directory
Demo: activating a sample hook
Hands-on with Pre-Commit hooks
Writing a simple custom hook
Adding checks for commit messages, file changes, or secrets
Sharing hooks across a team
Other useful hooks
Exploring the uses for commit-msg
, pre-push
and post-merge
Leveraging the ecosystem
Introduction to pre-commit
framework (multi-language support, shareable configs)
Using Husky for JavaScript/Node projects
Comparing custom hooks vs. ecosystem tools
Building complex hooks
Either pick from a prepared list of fun/useful hook ideas or add support for a project you already use
Putting It All Together
Designing a hook strategy for your workflow/team
Where hooks fit in modern CI practices
Resources to go further
What Git hooks are and how they fit into development workflows
Hands-on experience writing and customizing Git hooks
How you can integrate hooks into team projects with frameworks like pre-commit
or Husky
Explore creative and practical applications to make workflows smoother
By covering projects that enable you to go beyond default IDE code-formatting and linting in general functionalities as well as in specific field examples, the workshop aims to get folks aware about adopting existing pre-commit hooks as well as to start thinking creatively in this space about how they can make hooks to work within their own specific contexts and software practices.