1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
\r
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
6 <meta name="generator" content="AsciiDoc 7.0.1" />
\r
7 <style type="text/css">
\r
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
11 border: 1px solid red;
\r
16 margin: 1em 5% 1em 5%;
\r
20 a:visited { color: fuchsia; }
\r
34 h1, h2, h3, h4, h5, h6 {
\r
36 font-family: sans-serif;
\r
38 margin-bottom: 0.5em;
\r
43 border-bottom: 2px solid silver;
\r
46 border-bottom: 2px solid silver;
\r
56 border: 1px solid silver;
\r
61 margin-bottom: 0.5em;
\r
71 font-family: sans-serif;
\r
78 font-family: sans-serif;
\r
82 font-family: sans-serif;
\r
84 border-top: 2px solid silver;
\r
90 padding-bottom: 0.5em;
\r
94 padding-bottom: 0.5em;
\r
98 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
\r
99 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
\r
100 div.admonitionblock {
\r
103 margin-bottom: 1.5em;
\r
105 div.admonitionblock {
\r
107 margin-bottom: 2.5em;
\r
110 div.content { /* Block element content. */
\r
114 /* Block element titles. */
\r
115 div.title, caption.title {
\r
116 font-family: sans-serif;
\r
120 margin-bottom: 0.5em;
\r
126 td div.title:first-child {
\r
129 div.content div.title:first-child {
\r
132 div.content + div.title {
\r
136 div.sidebarblock > div.content {
\r
137 background: #ffffee;
\r
138 border: 1px solid silver;
\r
142 div.listingblock > div.content {
\r
143 border: 1px solid silver;
\r
144 background: #f4f4f4;
\r
148 div.quoteblock > div.content {
\r
149 padding-left: 2.0em;
\r
151 div.quoteblock .attribution {
\r
155 div.admonitionblock .icon {
\r
156 vertical-align: top;
\r
159 text-decoration: underline;
\r
161 padding-right: 0.5em;
\r
163 div.admonitionblock td.content {
\r
164 padding-left: 0.5em;
\r
165 border-left: 2px solid silver;
\r
168 div.exampleblock > div.content {
\r
169 border-left: 2px solid silver;
\r
173 div.verseblock div.content {
\r
177 div.imageblock div.content { padding-left: 0; }
\r
178 div.imageblock img { border: 1px solid silver; }
\r
179 span.image img { border-style: none; }
\r
183 margin-bottom: 0.8em;
\r
188 font-style: italic;
\r
190 dd > *:first-child {
\r
195 list-style-position: outside;
\r
198 list-style-type: lower-alpha;
\r
201 div.tableblock > table {
\r
202 border-color: #527bbd;
\r
206 font-family: sans-serif;
\r
215 margin-bottom: 0.8em;
\r
218 vertical-align: top;
\r
219 font-style: italic;
\r
220 padding-right: 0.8em;
\r
223 vertical-align: top;
\r
227 div#footer-badges { display: none; }
\r
229 /* Workarounds for IE6's broken and incomplete CSS2. */
\r
231 div.sidebar-content {
\r
232 background: #ffffee;
\r
233 border: 1px solid silver;
\r
236 div.sidebar-title, div.image-title {
\r
237 font-family: sans-serif;
\r
240 margin-bottom: 0.5em;
\r
243 div.listingblock div.content {
\r
244 border: 1px solid silver;
\r
245 background: #f4f4f4;
\r
249 div.quoteblock-content {
\r
250 padding-left: 2.0em;
\r
253 div.exampleblock-content {
\r
254 border-left: 2px solid silver;
\r
255 padding-left: 0.5em;
\r
258 <title>Hooks used by git</title>
\r
262 <h1>Hooks used by git</h1>
\r
264 <div id="preamble">
\r
265 <div class="sectionbody">
\r
266 <p>Hooks are little scripts you can place in <tt>$GIT_DIR/hooks</tt>
\r
267 directory to trigger action at certain points. When
\r
268 <tt>git-init-db</tt> is run, a handful example hooks are copied in the
\r
269 <tt>hooks</tt> directory of the new repository, but by default they are
\r
270 all disabled. To enable a hook, make it executable with `chmod</p>
\r
272 <p>This document describes the currently defined hooks.</p>
\r
275 <h2>applypatch-msg</h2>
\r
276 <div class="sectionbody">
\r
277 <p>This hook is invoked by <tt>git-applypatch</tt> script, which is
\r
278 typically invoked by <tt>git-applymbox</tt>. It takes a single
\r
279 parameter, the name of the file that holds the proposed commit
\r
280 log message. Exiting with non-zero status causes the
\r
281 <em>git-applypatch</em> to abort before applying the patch.</p>
\r
282 <p>The hook is allowed to edit the message file in place, and can
\r
283 be used to normalize the message into some project standard
\r
284 format (if the project has one). It can also be used to refuse
\r
285 the commit after inspecting the message file.</p>
\r
286 <p>The default applypatch-msg hook, when enabled, runs the
\r
287 commit-msg hook, if the latter is enabled.</p>
\r
289 <h2>pre-applypatch</h2>
\r
290 <div class="sectionbody">
\r
291 <p>This hook is invoked by <tt>git-applypatch</tt> script, which is
\r
292 typically invoked by <tt>git-applymbox</tt>. It takes no parameter,
\r
293 and is invoked after the patch is applied, but before a commit
\r
294 is made. Exiting with non-zero status causes the working tree
\r
295 after application of the patch not committed.</p>
\r
296 <p>It can be used to inspect the current working tree and refuse to
\r
297 make a commit if it does not pass certain test.</p>
\r
298 <p>The default pre-applypatch hook, when enabled, runs the
\r
299 pre-commit hook, if the latter is enabled.</p>
\r
301 <h2>post-applypatch</h2>
\r
302 <div class="sectionbody">
\r
303 <p>This hook is invoked by <tt>git-applypatch</tt> script, which is
\r
304 typically invoked by <tt>git-applymbox</tt>. It takes no parameter,
\r
305 and is invoked after the patch is applied and a commit is made.</p>
\r
306 <p>This hook is meant primarily for notification, and cannot affect
\r
307 the outcome of <tt>git-applypatch</tt>.</p>
\r
309 <h2>pre-commit</h2>
\r
310 <div class="sectionbody">
\r
311 <p>This hook is invoked by <tt>git-commit</tt>, and can be bypassed
\r
312 with <tt>--no-verify</tt> option. It takes no parameter, and is
\r
313 invoked before obtaining the proposed commit log message and
\r
314 making a commit. Exiting with non-zero status from this script
\r
315 causes the <tt>git-commit</tt> to abort.</p>
\r
316 <p>The default pre-commit hook, when enabled, catches introduction
\r
317 of lines with trailing whitespaces and aborts the commit when
\r
318 a such line is found.</p>
\r
320 <h2>commit-msg</h2>
\r
321 <div class="sectionbody">
\r
322 <p>This hook is invoked by <tt>git-commit</tt>, and can be bypassed
\r
323 with <tt>--no-verify</tt> option. It takes a single parameter, the
\r
324 name of the file that holds the proposed commit log message.
\r
325 Exiting with non-zero status causes the <tt>git-commit</tt> to
\r
327 <p>The hook is allowed to edit the message file in place, and can
\r
328 be used to normalize the message into some project standard
\r
329 format (if the project has one). It can also be used to refuse
\r
330 the commit after inspecting the message file.</p>
\r
331 <p>The default commit-msg hook, when enabled, detects duplicate
\r
332 Signed-off-by: lines, and aborts the commit when one is found.</p>
\r
334 <h2>post-commit</h2>
\r
335 <div class="sectionbody">
\r
336 <p>This hook is invoked by <tt>git-commit</tt>. It takes no
\r
337 parameter, and is invoked after a commit is made.</p>
\r
338 <p>This hook is meant primarily for notification, and cannot affect
\r
339 the outcome of <tt>git-commit</tt>.</p>
\r
340 <p>The default post-commit hook, when enabled, demonstrates how to
\r
341 send out a commit notification e-mail.</p>
\r
344 <div class="sectionbody">
\r
345 <p>This hook is invoked by <tt>git-receive-pack</tt>, which is invoked
\r
346 when a <tt>git push</tt> is done against the repository. It takes
\r
347 three parameters, name of the ref being updated, old object name
\r
348 stored in the ref, and the new objectname to be stored in the
\r
349 ref. Exiting with non-zero status from this hook prevents
\r
350 <tt>git-receive-pack</tt> from updating the ref.</p>
\r
351 <p>This can be used to prevent <em>forced</em> update on certain refs by
\r
352 making sure that the object name is a commit object that is a
\r
353 descendant of the commit object named by the old object name.
\r
354 Another use suggested on the mailing list is to use this hook to
\r
355 implement access control which is finer grained than the one
\r
356 based on filesystem group.</p>
\r
357 <p>The standard output of this hook is sent to /dev/null; if you
\r
358 want to report something to the git-send-pack on the other end,
\r
359 you can redirect your output to your stderr.</p>
\r
361 <h2>post-update</h2>
\r
362 <div class="sectionbody">
\r
363 <p>This hook is invoked by <tt>git-receive-pack</tt>, which is invoked
\r
364 when a <tt>git push</tt> is done against the repository. It takes
\r
365 variable number of parameters; each of which is the name of ref
\r
366 that was actually updated.</p>
\r
367 <p>This hook is meant primarily for notification, and cannot affect
\r
368 the outcome of <tt>git-receive-pack</tt>.</p>
\r
369 <p>The default post-update hook, when enabled, runs
\r
370 <tt>git-update-server-info</tt> to keep the information used by dumb
\r
371 transport up-to-date.</p>
\r
372 <p>The standard output of this hook is sent to /dev/null; if you
\r
373 want to report something to the git-send-pack on the other end,
\r
374 you can redirect your output to your stderr.</p>
\r
377 <div id="footer-text">
\r
378 Last updated 27-Dec-2005 00:17:09 PDT
\r