😎 A collection of awesome Git Hooks
Clone or download
Latest commit f2466ea Jan 23, 2019

README.md

Awesome Git Hooks

awesome PRs Welcome @aitemr

A curated list of awesome Git hooks

About

Git Hooks are scripts that run automatically every time a particular event occurs in a Git repository.

Contents

Useful Git Hooks scripts

  • pre-commit - This hook is called before obtaining the proposed commit message.
  • prepare-commit-msg - Called after receiving the default commit message, just prior to firing up the commit message editor.
  • pre-receive - This is called on the remote repo just before updating the pushed refs.
  • commit-msg - Can be used to adjust the message after it has been edited in order to ensure conformity to a standard or to reject based on any criteria.
  • pre-push - Called prior to a push to a remote. In addition to the parameters, additional information, separated by a space is passed in through stdin in the form of .
  • pre-auto-gc - Is used to do some checks before automatically cleaning repos.
  • pre-rebase - Called when rebasing a branch. Mainly used to halt the rebase if it is not desirable.
  • applypatch-msg - Can edit the commit message file and is often used to verify or actively format a patch's message to a project's standards.
  • post-receive - This is run on the remote when pushing after the all refs have been updated. It does not take parameters, but receives info through stdin in the form of .
  • post-rewrite - This is called when git commands are rewriting already committed data.

Soon πŸ™ˆ

  • pre-applypatch - This is actually called after the patch is applied, but before the changes are committed.
  • post-applypatch - This hook is run after the patch is applied and committed.
  • post-commit - Called after the actual commit is made. Because of this, it cannot disrupt the commit.
  • post-checkout - Run when a checkout is called after updating the worktree or after git clone.
  • post-merge - Called after a merge. Because of this, it cannot abort a merge.
  • update - This is run on the remote repo once for each ref being pushed instead of once for each push.
  • post-update - This is run only once after all of the refs have been pushed.

Tools

  • Husky - 🐢 Git hooks made easy
  • Komondor - 🐩 Git Hooks for Swift projects
  • Quickhook - Faster Git hook (pre-commit, etc.) runner
  • git-hooks - A tool to manage project, user, and global Git hooks
  • overcommit - A fully configurable and extendable Git hook manager

Articles

Support

If you have a question, find a bug, or just want to say hi, please open an issue on GitHub. If you want to contribute, please read the guide.

License

CC0

To the extent possible under law, Islam Temirbek has waived all copyright and related or neighboring rights to this work.