summaryrefslogtreecommitdiff
path: root/devdocs/git/git-hook.html
blob: 7cf8e1d3085b2242ab9e099af8589f7d8adb97e2 (plain)
1
2
3
4
5
6
<h1>git-hook</h1>  <h2 id="_name">Name</h2> <div class="sectionbody">  <p>git-hook - Run git hooks</p>  </div>   <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git hook run [--ignore-missing] [--to-stdin=&lt;path&gt;] &lt;hook-name&gt; [-- &lt;hook-args&gt;]</pre> </div> </div>   <h2 id="_description">Description</h2> <div class="sectionbody">  <p>A command interface for running git hooks (see <a href="githooks">githooks[5]</a>), for use by other scripted git commands.</p>  </div>   <h2 id="_subcommands">Subcommands</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-hook.txt-run"> run </dt> <dd> <p>Run the <code>&lt;hook-name&gt;</code> hook. See <a href="githooks">githooks[5]</a> for supported hook names.</p>  <p>Any positional arguments to the hook should be passed after a mandatory <code>--</code> (or <code>--end-of-options</code>, see <a href="gitcli">gitcli[7]</a>). See <a href="githooks">githooks[5]</a> for arguments hooks might expect (if any).</p>  </dd> </dl> </div> </div>   <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-hook.txt---to-stdin"> --to-stdin </dt> <dd> <p>For "run"; specify a file which will be streamed into the hook’s stdin. The hook will receive the entire file from beginning to EOF.</p> </dd> <dt class="hdlist1" id="Documentation/git-hook.txt---ignore-missing"> --ignore-missing </dt> <dd> <p>Ignore any missing hook by quietly returning zero. Used for tools that want to do a blind one-shot run of a hook that may or may not be present.</p> </dd> </dl> </div> </div>   <h2 id="_see_also">See also</h2> <div class="sectionbody">  <p><a href="githooks">githooks[5]</a></p>  </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
    <a href="https://git-scm.com/docs/git-hook" class="_attribution-link">https://git-scm.com/docs/git-hook</a>
  </p>
</div>