Skip to content

This repository aims to allow you to use global hooks without overriding local ones.

License

Notifications You must be signed in to change notification settings

SlevinWasAlreadyTaken/git-global-to-local-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-global-to-local-hooks

This repository allows you to use global hooks without overriding local ones.

How?

  1. It uses the classic global hooks strategy by setting a global git configuration to change the place git will look for hooks.
  2. It installs forwarding global hooks that will by default just trigger project local hooks considering the project you run a git command on (using git rev-parse).
  3. It installs a forwarding global hook for all existing kind of hooks: see the documentation:
    • applypatch-msg
    • commit-msg
    • fsmonitor-watchman
    • post-update
    • pre-applypatch
    • pre-commit
    • pre-merge-commit
    • pre-push
    • pre-rebase
    • pre-receive
    • prepare-commit-msg
    • push-to-checkout
    • run-local-hook
    • update
  4. In conclusion, to install this should not affect the way your current hooks are triggered. You can then update any default forwarding global hook to have a global hook running on all your projects, without overriding local ones that will be called afterward.

Installation

The global hooks will be installed in $HOME/.git-global.hooks.

sh install.sh

License

The code is released under the AGPLv3. If subdirectories include a different license, that license applies instead.

About

This repository aims to allow you to use global hooks without overriding local ones.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages