Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (37 sloc) 1.91 kb
c85c4a65 »
2009-11-21 Add initial README file.
1
2 git-hooks - Generic Git hooks
3
58f898c3 »
2011-08-05 Add project page URL.
4
5 http://benediktmeurer.de/git-hooks
6
7
c85c4a65 »
2009-11-21 Add initial README file.
8 Git Hooks provides a simple mechanism to manage hooks for several Git
9 repositories in a unified and simple way. It allows you to install hook
10 scripts in a central location and use them for your Git repositories.
11
af7ef114 »
2009-11-22 Add installation instructions to the README.
12
13 Installation
14
15 You need CMake and GCC in order to build and install git-hooks. You will
16 also need to have Git and Perl installed for the hooks to work properly.
17 To build git-hooks run
18
19 $ cmake /path/to/git-hooks
20 $ make
21
22 in a new directory (preferably, tho you may also run it from the source
23 directory). Then, use
24
25 $ make install
26
27 to install git-hooks. This will install git-hooks to /usr/local. You can
28 use ccmake to change the installation prefix. Below, we will assume that
29 you installed git-hooks to /usr/local.
30
31
32 Repository setup
33
34 To setup a repository using git-hooks, just use the repository template
35 that ships with git-hooks.
36
37 $ mkdir myrepo.git
38 $ cd myrepo.git
39 $ git --bare init --template=/usr/local/share/git-hooks/template ...
40
41 This will setup the new repository myrepo.git with git-hooks. Check the
42 sample config file that will be created for myrepo.git.
43
44
45 Repository migration
46
47 To migrate an existing repository to use git-hooks, you should first backup
48 your existing hook scripts. Then replace the hooks with the ones from
49 /usr/local/share/git-hooks/template/hooks. Afterwards, you should migrate
50 your previous hook scripts to global hook scripts used by git-hooks.
51
52
53 Configuration
54
55 The git-hooks package includes several useful hooks, which can be configured
56 to your needs using git config settings in your repository (or even global
57 settings from /etc/gitconfig). The /usr/local/share/git-hooks/template/config
58 file provides a sample configuration file.
59
60 Please see the hook scripts in /usr/local/share/git-hooks/*.d/ for the
61 various supported config settings.
Something went wrong with that request. Please try again.