What are Git Hooks and how to create a Git Hook Script?
This tutorial will show you what are git hooks, how to create a hook and run a custom script on git commit command. Dive right in with this relaxing overview and practical demonstration of the power of Git hooks!
# What are Git hooks?
Git hooks allow you to run your own scripts whenever important events occur in the Git life-cycle, like committing, merging, and pushing. That means the only limit to Git hooks is your imagination (and the patience of your coworkers).
# Index of contents
* 00:07: Overview of Git hooks
* 00:46: The “nitty gritty” of git hooks
* 01:18: Default sample hooks
* 01:41: Location of Git’s repo template
* 02:08: Pre vs Post hooks
* 02:52: zero == hero
* 03:36: Local vs server side hooks
* 03:49: Enabling a hook
* 04:22: Gotchas (pitfalls)
– 04:24: Surprises!
– 04:45: Hooks not source controlled
– 05:42: bypass a hook with –no-verify
– 05:59: silent failure mode
* 06:20: Getting practical with git hooks
* 06:27: Verify name/email with pre-commit hook
* 07:57: Ensure no words match a “blacklist”
* 08:16: Live demo of name/email pre-commit hook
* 09:43: pre-commit vs pre-push hooks
* 10:32: Your choice of scripting language (#! shebang!)
Thanks for watching. Subscribe now and enjoy relaxing tech tutorials.
Written by admin