forked from ddddavidmartin/Pre-commit-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
49 lines (35 loc) · 1.88 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
How to get the pre-commit hooks.
================================
The hooks coming with this file are located at
https://github.com/githubbrowser/Pre-commit-hooks
You can download them directly or do a checkout with
git clone git://github.com/githubbrowser/Pre-commit-hooks.git git-hooks
How to install the pre-commit hooks.
====================================
Copy the pre-commit hooks into the .git/hooks folder of your local git
repository. You can do this by hand or by calling
./install_hooks.sh /path/to/repository
The script will ask if any existing files are to be overwritten.
Note that the existing pre-commit hook has to be overwritten.
You can rename it and add it to the list of executed hooks in the
pre-commit file included with these scripts to have it executed as
before.
Some of the pre-commit hooks have settings that need to be specified.
They should be self-explanatory and are located at the top of the
respective file. If a hook fails because of invalid settings it will
report it and abort the commmit.
How to select which hooks are installed or executed.
====================================================
You can specify which hooks are installed in install_hooks.sh.
You can specify which hooks are run before commits in pre-commit.
Note that by default all hooks are installed and specified to be run.
How to use the pre-commit hooks.
================================
When the hooks are correctly installed all you have to do is hack away
and commit files. The hooks will be executed and if any check fails
the commit will be aborted and a notice printed.
You can skip pre-commit checking with the option --no-verify.
For example 'git commit foo.c --no-verify'. This can come in handy
when you are checking in files that are not supposed to be parsed by
stylechecks (like .tex documentation) or you don't mind your commit
not compiling (which is evil and makes you an evil person).