blob: db2093766ea353120faef51ce3543dbcf68b42a7 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.0.2" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
border: 1px solid red;
*/
}
body {
margin: 1em 5% 1em 5%;
}
a { color: blue; }
a:visited { color: fuchsia; }
em {
font-style: italic;
}
strong {
font-weight: bold;
}
tt {
color: navy;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
font-family: sans-serif;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1 {
border-bottom: 2px solid silver;
}
h2 {
border-bottom: 2px solid silver;
padding-top: 0.5em;
}
div.sectionbody {
font-family: serif;
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
pre {
padding: 0;
margin: 0;
}
span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
font-size: 1.2em;
}
span#email {
}
span#revision {
font-family: sans-serif;
}
div#footer {
font-family: sans-serif;
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
div#footer-text {
float: left;
padding-bottom: 0.5em;
}
div#footer-badges {
float: right;
padding-bottom: 0.5em;
}
div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-right: 10%;
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
font-family: sans-serif;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock > div.content {
padding-left: 2.0em;
}
div.quoteblock .attribution {
text-align: right;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.verseblock div.content {
white-space: pre;
}
div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: italic;
}
dd > *:first-child {
margin-top: 0;
}
ul, ol {
list-style-position: outside;
}
ol.olist2 {
list-style-type: lower-alpha;
}
div.tableblock > table {
border-color: #527bbd;
border-width: 3px;
}
thead {
font-family: sans-serif;
font-weight: bold;
}
tfoot {
font-weight: bold;
}
div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
td.hlist1 {
vertical-align: top;
font-style: italic;
padding-right: 0.8em;
}
td.hlist2 {
vertical-align: top;
}
@media print {
div#footer-badges { display: none; }
}
include::./stylesheets/xhtml11-manpage.css[]
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.sidebar-title, div.image-title {
font-family: sans-serif;
font-weight: bold;
margin-top: 0.0em;
margin-bottom: 0.5em;
}
div.listingblock div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock-content {
padding-left: 2.0em;
}
div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
</style>
<title>git-receive-pack(1)</title>
</head>
<body>
<div id="header">
<h1>
git-receive-pack(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>git-receive-pack -
Receive what is pushed into it
</p>
</div>
</div>
<h2>SYNOPSIS</h2>
<div class="sectionbody">
<p><em>git-receive-pack</em> &lt;directory&gt;</p>
</div>
<h2>DESCRIPTION</h2>
<div class="sectionbody">
<p>Invoked by <em>git-send-pack</em> and updates the repository with the
information fed from the remote end.</p>
<p>This command is usually not invoked directly by the end user.
The UI for the protocol is on the <em>git-send-pack</em> side, and the
program pair is meant to be used to push updates to remote
repository. For pull operations, see <em>git-fetch-pack</em>.</p>
<p>The command allows for creation and fast forwarding of sha1 refs
(heads/tags) on the remote end (strictly speaking, it is the
local end receive-pack runs, but to the user who is sitting at
the send-pack end, it is updating the remote. Confused?)</p>
<p>Before each ref is updated, if $GIT_DIR/hooks/update file exists
and executable, it is called with three parameters:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$GIT_DIR/hooks/update refname sha1-old sha1-new</tt></pre>
</div></div>
<p>The refname parameter is relative to $GIT_DIR; e.g. for the
master head this is "refs/heads/master". Two sha1 are the
object names for the refname before and after the update. Note
that the hook is called before the refname is updated, so either
should match what is recorded in refname.</p>
<p>The hook should exit with non-zero status if it wants to
disallow updating the named ref. Otherwise it should exit with
zero.</p>
<p>Using this hook, it is easy to generate mails on updates to
the local repository. This example script sends a mail with
the commits pushed to the repository:</p>
<div class="literalblock">
<div class="content">
<pre><tt>#!/bin/sh
# mail out commit update information.
if expr "$2" : '0*$' &gt;/dev/null
then
echo "Created a new ref, with the following commits:"
git-rev-list --pretty "$2"
else
echo "New commits:"
git-rev-list --pretty "$3" "^$2"
fi |
mail -s "Changes to ref $1" commit-list@mydomain
exit 0</tt></pre>
</div></div>
<p>Another hook $GIT_DIR/hooks/post-update, if exists and
executable, is called with the list of refs that have been
updated. This can be used to implement repository wide cleanup
task if needed. The exit code from this hook invocation is
ignored; the only thing left for git-receive-pack to do at that
point is to exit itself anyway. This hook can be used, for
example, to run "git-update-server-info" if the repository is
packed and is served via a dumb transport.</p>
<div class="literalblock">
<div class="content">
<pre><tt>#!/bin/sh
exec git-update-server-info</tt></pre>
</div></div>
<p>There are other real-world examples of using update and
post-update hooks found in the Documentation/howto directory.</p>
<p>git-receive-pack honours the receive.denyNonFastforwards flag, which
tells it if updates to a ref should be denied if they are not fast-forwards.</p>
</div>
<h2>OPTIONS</h2>
<div class="sectionbody">
<dl>
<dt>
&lt;directory&gt;
</dt>
<dd>
<p>
The repository to sync into.
</p>
</dd>
</dl>
</div>
<h2>SEE ALSO</h2>
<div class="sectionbody">
<p><a href="git-send-pack.html">git-send-pack(1)</a></p>
</div>
<h2>Author</h2>
<div class="sectionbody">
<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
</div>
<h2>Documentation</h2>
<div class="sectionbody">
<p>Documentation by Junio C Hamano.</p>
</div>
<h2>GIT</h2>
<div class="sectionbody">
<p>Part of the <a href="git.html">git(7)</a> suite</p>
</div>
<div id="footer">
<div id="footer-text">
Last updated 03-Oct-2006 08:41:21 UTC
</div>
</div>
</body>
</html>