https://github.com/bmeurer/git-hooks
Git Hooks provides a simple mechanism to manage hooks for several Git repositories in a unified and simple way. It allows you to install hook scripts in a central location and use them for your Git repositories.
https://github.com/bmeurer/git-hooks
Last synced: over 1 year ago
JSON representation
Git Hooks provides a simple mechanism to manage hooks for several Git repositories in a unified and simple way. It allows you to install hook scripts in a central location and use them for your Git repositories.
- Host: GitHub
- URL: https://github.com/bmeurer/git-hooks
- Owner: bmeurer
- License: gpl-2.0
- Created: 2011-05-28T18:11:33.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-05T18:04:06.000Z (almost 15 years ago)
- Last Synced: 2025-01-22T21:32:11.843Z (over 1 year ago)
- Language: Shell
- Homepage: http://benediktmeurer.de/git-hooks
- Size: 112 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
git-hooks - Generic Git hooks
http://benediktmeurer.de/git-hooks
Git Hooks provides a simple mechanism to manage hooks for several Git
repositories in a unified and simple way. It allows you to install hook
scripts in a central location and use them for your Git repositories.
Installation
You need CMake and GCC in order to build and install git-hooks. You will
also need to have Git and Perl installed for the hooks to work properly.
To build git-hooks run
$ cmake /path/to/git-hooks
$ make
in a new directory (preferably, tho you may also run it from the source
directory). Then, use
$ make install
to install git-hooks. This will install git-hooks to /usr/local. You can
use ccmake to change the installation prefix. Below, we will assume that
you installed git-hooks to /usr/local.
Repository setup
To setup a repository using git-hooks, just use the repository template
that ships with git-hooks.
$ mkdir myrepo.git
$ cd myrepo.git
$ git --bare init --template=/usr/local/share/git-hooks/template ...
This will setup the new repository myrepo.git with git-hooks. Check the
sample config file that will be created for myrepo.git.
Repository migration
To migrate an existing repository to use git-hooks, you should first backup
your existing hook scripts. Then replace the hooks with the ones from
/usr/local/share/git-hooks/template/hooks. Afterwards, you should migrate
your previous hook scripts to global hook scripts used by git-hooks.
Configuration
The git-hooks package includes several useful hooks, which can be configured
to your needs using git config settings in your repository (or even global
settings from /etc/gitconfig). The /usr/local/share/git-hooks/template/config
file provides a sample configuration file.
Please see the hook scripts in /usr/local/share/git-hooks/*.d/ for the
various supported config settings.