--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
+<style type="text/css">\r
+/* Debug borders */\r
+p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
+/*\r
+ border: 1px solid red;\r
+*/\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a { color: blue; }\r
+a:visited { color: fuchsia; }\r
+\r
+em {\r
+ font-style: italic;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+}\r
+\r
+tt {\r
+ color: navy;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ border-bottom: 2px solid silver;\r
+ padding-top: 0.5em;\r
+}\r
+\r
+div.sectionbody {\r
+ font-family: serif;\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+span#author {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ font-size: 1.2em;\r
+}\r
+span#email {\r
+}\r
+span#revision {\r
+ font-family: sans-serif;\r
+}\r
+\r
+div#footer {\r
+ font-family: sans-serif;\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+div#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+div#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+div#preamble,\r
+div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-right: 10%;\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.5em;\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock > div.content {\r
+ padding-left: 2.0em;\r
+}\r
+div.quoteblock .attribution {\r
+ text-align: right;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 2px solid silver;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 2px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.verseblock div.content {\r
+ white-space: pre;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+div.imageblock img { border: 1px solid silver; }\r
+span.image img { border-style: none; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: italic;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.olist2 {\r
+ list-style-type: lower-alpha;\r
+}\r
+\r
+div.tableblock > table {\r
+ border-color: #527bbd;\r
+ border-width: 3px;\r
+}\r
+thead {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+}\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+\r
+div.hlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+td.hlist1 {\r
+ vertical-align: top;\r
+ font-style: italic;\r
+ padding-right: 0.8em;\r
+}\r
+td.hlist2 {\r
+ vertical-align: top;\r
+}\r
+\r
+@media print {\r
+ div#footer-badges { display: none; }\r
+}\r
+include::./stylesheets/xhtml11-manpage.css[]\r
+/* Workarounds for IE6's broken and incomplete CSS2. */\r
+\r
+div.sidebar-content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+div.sidebar-title, div.image-title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ margin-top: 0.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+div.listingblock div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock-content {\r
+ padding-left: 2.0em;\r
+}\r
+\r
+div.exampleblock-content {\r
+ border-left: 2px solid silver;\r
+ padding-left: 0.5em;\r
+}\r
+</style>\r
+<title>githooks(5)</title>\r
+</head>\r
+<body>\r
+<div id="header">\r
+<h1>\r
+githooks(5) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>githooks -\r
+ Hooks used by git\r
+</p>\r
+</div>\r
+</div>\r
+<h2>SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<p>$GIT_DIR/hooks/*</p>\r
+</div>\r
+<h2>DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<p>Hooks are little scripts you can place in <tt>$GIT_DIR/hooks</tt>\r
+directory to trigger action at certain points. When\r
+<tt>git-init</tt> is run, a handful example hooks are copied in the\r
+<tt>hooks</tt> directory of the new repository, but by default they are\r
+all disabled. To enable a hook, make it executable with <tt>chmod +x</tt>.</p>\r
+<p>This document describes the currently defined hooks.</p>\r
+</div>\r
+<h2>applypatch-msg</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-am</tt> script. It takes a single\r
+parameter, the name of the file that holds the proposed commit\r
+log message. Exiting with non-zero status causes\r
+<tt>git-am</tt> to abort before applying the patch.</p>\r
+<p>The hook is allowed to edit the message file in place, and can\r
+be used to normalize the message into some project standard\r
+format (if the project has one). It can also be used to refuse\r
+the commit after inspecting the message file.</p>\r
+<p>The default <em>applypatch-msg</em> hook, when enabled, runs the\r
+<em>commit-msg</em> hook, if the latter is enabled.</p>\r
+</div>\r
+<h2>pre-applypatch</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-am</tt>. It takes no parameter, and is\r
+invoked after the patch is applied, but before a commit is made.</p>\r
+<p>If it exits with non-zero status, then the working tree will not be\r
+committed after applying the patch.</p>\r
+<p>It can be used to inspect the current working tree and refuse to\r
+make a commit if it does not pass certain test.</p>\r
+<p>The default <em>pre-applypatch</em> hook, when enabled, runs the\r
+<em>pre-commit</em> hook, if the latter is enabled.</p>\r
+</div>\r
+<h2>post-applypatch</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-am</tt>. It takes no parameter,\r
+and is invoked after the patch is applied and a commit is made.</p>\r
+<p>This hook is meant primarily for notification, and cannot affect\r
+the outcome of <tt>git-am</tt>.</p>\r
+</div>\r
+<h2>pre-commit</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-commit</tt>, and can be bypassed\r
+with <tt>--no-verify</tt> option. It takes no parameter, and is\r
+invoked before obtaining the proposed commit log message and\r
+making a commit. Exiting with non-zero status from this script\r
+causes the <tt>git-commit</tt> to abort.</p>\r
+<p>The default <em>pre-commit</em> hook, when enabled, catches introduction\r
+of lines with trailing whitespaces and aborts the commit when\r
+such a line is found.</p>\r
+<p>All the <tt>git-commit</tt> hooks are invoked with the environment\r
+variable <tt>GIT_EDITOR=:</tt> if the command will not bring up an editor\r
+to modify the commit message.</p>\r
+</div>\r
+<h2>prepare-commit-msg</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-commit</tt> right after preparing the\r
+default log message, and before the editor is started.</p>\r
+<p>It takes one to three parameters. The first is the name of the file\r
+that the commit log message. The second is the source of the commit\r
+message, and can be: <tt>message</tt> (if a <tt>\-m</tt> or <tt>\-F</tt> option was\r
+given); <tt>template</tt> (if a <tt>\-t</tt> option was given or the\r
+configuration option <tt>commit.template</tt> is set); <tt>merge</tt> (if the\r
+commit is a merge or a <tt>.git/MERGE_MSG</tt> file exists); <tt>squash</tt>\r
+(if a <tt>.git/SQUASH_MSG</tt> file exists); or <tt>commit</tt>, followed by\r
+a commit SHA1 (if a <tt>\-c</tt>, <tt>\-C</tt> or <tt>--amend</tt> option was given).</p>\r
+<p>If the exit status is non-zero, <tt>git-commit</tt> will abort.</p>\r
+<p>The purpose of the hook is to edit the message file in place, and\r
+it is not suppressed by the <tt>--no-verify</tt> option. A non-zero exit\r
+means a failure of the hook and aborts the commit. It should not\r
+be used as replacement for pre-commit hook.</p>\r
+<p>The sample <tt>prepare-commit-msg</tt> hook that comes with git comments\r
+out the <tt>Conflicts:</tt> part of a merge's commit message.</p>\r
+</div>\r
+<h2>commit-msg</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-commit</tt>, and can be bypassed\r
+with <tt>--no-verify</tt> option. It takes a single parameter, the\r
+name of the file that holds the proposed commit log message.\r
+Exiting with non-zero status causes the <tt>git-commit</tt> to\r
+abort.</p>\r
+<p>The hook is allowed to edit the message file in place, and can\r
+be used to normalize the message into some project standard\r
+format (if the project has one). It can also be used to refuse\r
+the commit after inspecting the message file.</p>\r
+<p>The default <em>commit-msg</em> hook, when enabled, detects duplicate\r
+"Signed-off-by" lines, and aborts the commit if one is found.</p>\r
+</div>\r
+<h2>post-commit</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-commit</tt>. It takes no\r
+parameter, and is invoked after a commit is made.</p>\r
+<p>This hook is meant primarily for notification, and cannot affect\r
+the outcome of <tt>git-commit</tt>.</p>\r
+</div>\r
+<h2>post-checkout</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked when a <tt>git-checkout</tt> is run after having updated the\r
+worktree. The hook is given three parameters: the ref of the previous HEAD,\r
+the ref of the new HEAD (which may or may not have changed), and a flag\r
+indicating whether the checkout was a branch checkout (changing branches,\r
+flag=1) or a file checkout (retrieving a file from the index, flag=0).\r
+This hook cannot affect the outcome of <tt>git-checkout</tt>.</p>\r
+<p>This hook can be used to perform repository validity checks, auto-display\r
+differences from the previous HEAD if different, or set working dir metadata\r
+properties.</p>\r
+</div>\r
+<h2>post-merge</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-merge</tt>, which happens when a <tt>git pull</tt>\r
+is done on a local repository. The hook takes a single parameter, a status\r
+flag specifying whether or not the merge being done was a squash merge.\r
+This hook cannot affect the outcome of <tt>git-merge</tt> and is not executed,\r
+if the merge failed due to conflicts.</p>\r
+<p>This hook can be used in conjunction with a corresponding pre-commit hook to\r
+save and restore any form of metadata associated with the working tree\r
+(eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl\r
+for an example of how to do this.</p>\r
+</div>\r
+<h2><a id="pre-receive"></a>pre-receive</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-receive-pack</tt> on the remote repository,\r
+which happens when a <tt>git push</tt> is done on a local repository.\r
+Just before starting to update refs on the remote repository, the\r
+pre-receive hook is invoked. Its exit status determines the success\r
+or failure of the update.</p>\r
+<p>This hook executes once for the receive operation. It takes no\r
+arguments, but for each ref to be updated it receives on standard\r
+input a line of the format:</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt><old-value> SP <new-value> SP <ref-name> LF</tt></pre>\r
+</div></div>\r
+<p>where <tt><old-value></tt> is the old object name stored in the ref,\r
+<tt><new-value></tt> is the new object name to be stored in the ref and\r
+<tt><ref-name></tt> is the full name of the ref.\r
+When creating a new ref, <tt><old-value></tt> is 40 <tt>0</tt>.</p>\r
+<p>If the hook exits with non-zero status, none of the refs will be\r
+updated. If the hook exits with zero, updating of individual refs can\r
+still be prevented by the <a href="#update"><em>update</em></a> hook.</p>\r
+<p>Both standard output and standard error output are forwarded to\r
+<tt>git-send-pack</tt> on the other end, so you can simply <tt>echo</tt> messages\r
+for the user.</p>\r
+</div>\r
+<h2><a id="update"></a>update</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-receive-pack</tt> on the remote repository,\r
+which happens when a <tt>git push</tt> is done on a local repository.\r
+Just before updating the ref on the remote repository, the update hook\r
+is invoked. Its exit status determines the success or failure of\r
+the ref update.</p>\r
+<p>The hook executes once for each ref to be updated, and takes\r
+three parameters:</p>\r
+<ul>\r
+<li>\r
+<p>\r
+the name of the ref being updated,\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+the old object name stored in the ref,\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+and the new objectname to be stored in the ref.\r
+</p>\r
+</li>\r
+</ul>\r
+<p>A zero exit from the update hook allows the ref to be updated.\r
+Exiting with a non-zero status prevents <tt>git-receive-pack</tt>\r
+from updating that ref.</p>\r
+<p>This hook can be used to prevent <em>forced</em> update on certain refs by\r
+making sure that the object name is a commit object that is a\r
+descendant of the commit object named by the old object name.\r
+That is, to enforce a "fast forward only" policy.</p>\r
+<p>It could also be used to log the old..new status. However, it\r
+does not know the entire set of branches, so it would end up\r
+firing one e-mail per ref when used naively, though. The\r
+<a href="#post-receive"><em>post-receive</em></a> hook is more suited to that.</p>\r
+<p>Another use suggested on the mailing list is to use this hook to\r
+implement access control which is finer grained than the one\r
+based on filesystem group.</p>\r
+<p>Both standard output and standard error output are forwarded to\r
+<tt>git-send-pack</tt> on the other end, so you can simply <tt>echo</tt> messages\r
+for the user.</p>\r
+<p>The default <em>update</em> hook, when enabled--and with\r
+<tt>hooks.allowunannotated</tt> config option turned on--prevents\r
+unannotated tags to be pushed.</p>\r
+</div>\r
+<h2><a id="post-receive"></a>post-receive</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-receive-pack</tt> on the remote repository,\r
+which happens when a <tt>git push</tt> is done on a local repository.\r
+It executes on the remote repository once after all the refs have\r
+been updated.</p>\r
+<p>This hook executes once for the receive operation. It takes no\r
+arguments, but gets the same information as the\r
+<a href="#pre-receive"><em>pre-receive</em></a>\r
+hook does on its standard input.</p>\r
+<p>This hook does not affect the outcome of <tt>git-receive-pack</tt>, as it\r
+is called after the real work is done.</p>\r
+<p>This supersedes the <a href="#post-update"><em>post-update</em></a> hook in that it gets\r
+both old and new values of all the refs in addition to their\r
+names.</p>\r
+<p>Both standard output and standard error output are forwarded to\r
+<tt>git-send-pack</tt> on the other end, so you can simply <tt>echo</tt> messages\r
+for the user.</p>\r
+<p>The default <em>post-receive</em> hook is empty, but there is\r
+a sample script <tt>post-receive-email</tt> provided in the <tt>contrib/hooks</tt>\r
+directory in git distribution, which implements sending commit\r
+emails.</p>\r
+</div>\r
+<h2><a id="post-update"></a>post-update</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-receive-pack</tt> on the remote repository,\r
+which happens when a <tt>git push</tt> is done on a local repository.\r
+It executes on the remote repository once after all the refs have\r
+been updated.</p>\r
+<p>It takes a variable number of parameters, each of which is the\r
+name of ref that was actually updated.</p>\r
+<p>This hook is meant primarily for notification, and cannot affect\r
+the outcome of <tt>git-receive-pack</tt>.</p>\r
+<p>The <em>post-update</em> hook can tell what are the heads that were pushed,\r
+but it does not know what their original and updated values are,\r
+so it is a poor place to do log old..new. The\r
+<a href="#post-receive"><em>post-receive</em></a> hook does get both original and\r
+updated values of the refs. You might consider it instead if you need\r
+them.</p>\r
+<p>When enabled, the default <em>post-update</em> hook runs\r
+<tt>git-update-server-info</tt> to keep the information used by dumb\r
+transports (e.g., HTTP) up-to-date. If you are publishing\r
+a git repository that is accessible via HTTP, you should\r
+probably enable this hook.</p>\r
+<p>Both standard output and standard error output are forwarded to\r
+<tt>git-send-pack</tt> on the other end, so you can simply <tt>echo</tt> messages\r
+for the user.</p>\r
+</div>\r
+<h2>pre-auto-gc</h2>\r
+<div class="sectionbody">\r
+<p>This hook is invoked by <tt>git-gc --auto</tt>. It takes no parameter, and\r
+exiting with non-zero status from this script causes the <tt>git-gc --auto</tt>\r
+to abort.</p>\r
+</div>\r
+<h2>GIT</h2>\r
+<div class="sectionbody">\r
+<p>Part of the <a href="git.html">git(7)</a> suite</p>\r
+</div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+Last updated 14-May-2008 22:24:43 UTC\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r