Autogenerated HTML docs for v1.7.5.2-315-g11bc3
[git/jnareb-git.git] / git-remote-helpers.html
blobe0210abe67be96b367274a553111dbf17fadd3c0
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-remote-helpers(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-remote-helpers(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-remote-helpers -
411 Helper programs to interact with remote repositories
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p><em>git remote-&lt;transport&gt;</em> &lt;repository&gt; [&lt;URL&gt;]</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p>Remote helper programs are normally not used directly by end users,
422 but they are invoked by git when it needs to interact with remote
423 repositories git does not support natively. A given helper will
424 implement a subset of the capabilities documented here. When git
425 needs to interact with a repository using a remote helper, it spawns
426 the helper as an independent process, sends commands to the helper&#8217;s
427 standard input, and expects results from the helper&#8217;s standard
428 output. Because a remote helper runs as an independent process from
429 git, there is no need to re-link git to add a new helper, nor any
430 need to link the helper with the implementation of git.</p></div>
431 <div class="paragraph"><p>Every helper must support the "capabilities" command, which git will
432 use to determine what other commands the helper will accept. Other
433 commands generally concern facilities like discovering and updating
434 remote refs, transporting objects between the object database and
435 the remote repository, and updating the local object store.</p></div>
436 <div class="paragraph"><p>Helpers supporting the <em>fetch</em> capability can discover refs from the
437 remote repository and transfer objects reachable from those refs to
438 the local object store. Helpers supporting the <em>push</em> capability can
439 transfer local objects to the remote repository and update remote refs.</p></div>
440 <div class="paragraph"><p>Git comes with a "curl" family of remote helpers, that handle various
441 transport protocols, such as <em>git-remote-http</em>, <em>git-remote-https</em>,
442 <em>git-remote-ftp</em> and <em>git-remote-ftps</em>. They implement the capabilities
443 <em>fetch</em>, <em>option</em>, and <em>push</em>.</p></div>
444 </div>
445 <h2 id="_invocation">INVOCATION</h2>
446 <div class="sectionbody">
447 <div class="paragraph"><p>Remote helper programs are invoked with one or (optionally) two
448 arguments. The first argument specifies a remote repository as in git;
449 it is either the name of a configured remote or a URL. The second
450 argument specifies a URL; it is usually of the form
451 <em>&lt;transport&gt;://&lt;address&gt;</em>, but any arbitrary string is possible.</p></div>
452 <div class="paragraph"><p>When git encounters a URL of the form <em>&lt;transport&gt;://&lt;address&gt;</em>, where
453 <em>&lt;transport&gt;</em> is a protocol that it cannot handle natively, it
454 automatically invokes <em>git remote-&lt;transport&gt;</em> with the full URL as
455 the second argument. If such a URL is encountered directly on the
456 command line, the first argument is the same as the second, and if it
457 is encountered in a configured remote, the first argument is the name
458 of that remote.</p></div>
459 <div class="paragraph"><p>A URL of the form <em>&lt;transport&gt;::&lt;address&gt;</em> explicitly instructs git to
460 invoke <em>git remote-&lt;transport&gt;</em> with <em>&lt;address&gt;</em> as the second
461 argument. If such a URL is encountered directly on the command line,
462 the first argument is <em>&lt;address&gt;</em>, and if it is encountered in a
463 configured remote, the first argument is the name of that remote.</p></div>
464 <div class="paragraph"><p>Additionally, when a configured remote has <em>remote.&lt;name&gt;.vcs</em> set to
465 <em>&lt;transport&gt;</em>, git explicitly invokes <em>git remote-&lt;transport&gt;</em> with
466 <em>&lt;name&gt;</em> as the first argument. If set, the second argument is
467 <em>remote.&lt;name&gt;.url</em>; otherwise, the second argument is omitted.</p></div>
468 </div>
469 <h2 id="_commands">COMMANDS</h2>
470 <div class="sectionbody">
471 <div class="paragraph"><p>Commands are given by the caller on the helper&#8217;s standard input, one per line.</p></div>
472 <div class="dlist"><dl>
473 <dt class="hdlist1">
474 <em>capabilities</em>
475 </dt>
476 <dd>
478 Lists the capabilities of the helper, one per line, ending
479 with a blank line. Each capability may be preceded with <em>*</em>,
480 which marks them mandatory for git version using the remote
481 helper to understand (unknown mandatory capability is fatal
482 error).
483 </p>
484 </dd>
485 <dt class="hdlist1">
486 <em>list</em>
487 </dt>
488 <dd>
490 Lists the refs, one per line, in the format "&lt;value&gt; &lt;name&gt;
491 [&lt;attr&gt; &#8230;]". The value may be a hex sha1 hash, "@&lt;dest&gt;" for
492 a symref, or "?" to indicate that the helper could not get the
493 value of the ref. A space-separated list of attributes follows
494 the name; unrecognized attributes are ignored. The list ends
495 with a blank line.
496 </p>
497 <div class="paragraph"><p>If <em>push</em> is supported this may be called as <em>list for-push</em>
498 to obtain the current refs prior to sending one or more <em>push</em>
499 commands to the helper.</p></div>
500 </dd>
501 <dt class="hdlist1">
502 <em>option</em> &lt;name&gt; &lt;value&gt;
503 </dt>
504 <dd>
506 Sets the transport helper option &lt;name&gt; to &lt;value&gt;. Outputs a
507 single line containing one of <em>ok</em> (option successfully set),
508 <em>unsupported</em> (option not recognized) or <em>error &lt;msg&gt;</em>
509 (option &lt;name&gt; is supported but &lt;value&gt; is not valid
510 for it). Options should be set before other commands,
511 and may influence the behavior of those commands.
512 </p>
513 <div class="paragraph"><p>Supported if the helper has the "option" capability.</p></div>
514 </dd>
515 <dt class="hdlist1">
516 <em>fetch</em> &lt;sha1&gt; &lt;name&gt;
517 </dt>
518 <dd>
520 Fetches the given object, writing the necessary objects
521 to the database. Fetch commands are sent in a batch, one
522 per line, terminated with a blank line.
523 Outputs a single blank line when all fetch commands in the
524 same batch are complete. Only objects which were reported
525 in the ref list with a sha1 may be fetched this way.
526 </p>
527 <div class="paragraph"><p>Optionally may output a <em>lock &lt;file&gt;</em> line indicating a file under
528 GIT_DIR/objects/pack which is keeping a pack until refs can be
529 suitably updated.</p></div>
530 <div class="paragraph"><p>Supported if the helper has the "fetch" capability.</p></div>
531 </dd>
532 <dt class="hdlist1">
533 <em>push</em> +&lt;src&gt;:&lt;dst&gt;
534 </dt>
535 <dd>
537 Pushes the given local &lt;src&gt; commit or branch to the
538 remote branch described by &lt;dst&gt;. A batch sequence of
539 one or more push commands is terminated with a blank line.
540 </p>
541 <div class="paragraph"><p>Zero or more protocol options may be entered after the last <em>push</em>
542 command, before the batch&#8217;s terminating blank line.</p></div>
543 <div class="paragraph"><p>When the push is complete, outputs one or more <em>ok &lt;dst&gt;</em> or
544 <em>error &lt;dst&gt; &lt;why&gt;?</em> lines to indicate success or failure of
545 each pushed ref. The status report output is terminated by
546 a blank line. The option field &lt;why&gt; may be quoted in a C
547 style string if it contains an LF.</p></div>
548 <div class="paragraph"><p>Supported if the helper has the "push" capability.</p></div>
549 </dd>
550 <dt class="hdlist1">
551 <em>import</em> &lt;name&gt;
552 </dt>
553 <dd>
555 Produces a fast-import stream which imports the current value
556 of the named ref. It may additionally import other refs as
557 needed to construct the history efficiently. The script writes
558 to a helper-specific private namespace. The value of the named
559 ref should be written to a location in this namespace derived
560 by applying the refspecs from the "refspec" capability to the
561 name of the ref.
562 </p>
563 <div class="paragraph"><p>Especially useful for interoperability with a foreign versioning
564 system.</p></div>
565 <div class="paragraph"><p>Supported if the helper has the "import" capability.</p></div>
566 </dd>
567 <dt class="hdlist1">
568 <em>connect</em> &lt;service&gt;
569 </dt>
570 <dd>
572 Connects to given service. Standard input and standard output
573 of helper are connected to specified service (git prefix is
574 included in service name so e.g. fetching uses <em>git-upload-pack</em>
575 as service) on remote side. Valid replies to this command are
576 empty line (connection established), <em>fallback</em> (no smart
577 transport support, fall back to dumb transports) and just
578 exiting with error message printed (can&#8217;t connect, don&#8217;t
579 bother trying to fall back). After line feed terminating the
580 positive (empty) response, the output of service starts. After
581 the connection ends, the remote helper exits.
582 </p>
583 <div class="paragraph"><p>Supported if the helper has the "connect" capability.</p></div>
584 </dd>
585 </dl></div>
586 <div class="paragraph"><p>If a fatal error occurs, the program writes the error message to
587 stderr and exits. The caller should expect that a suitable error
588 message has been printed if the child closes the connection without
589 completing a valid response for the current command.</p></div>
590 <div class="paragraph"><p>Additional commands may be supported, as may be determined from
591 capabilities reported by the helper.</p></div>
592 </div>
593 <h2 id="_capabilities">CAPABILITIES</h2>
594 <div class="sectionbody">
595 <div class="dlist"><dl>
596 <dt class="hdlist1">
597 <em>fetch</em>
598 </dt>
599 <dt class="hdlist1">
600 <em>option</em>
601 </dt>
602 <dt class="hdlist1">
603 <em>push</em>
604 </dt>
605 <dt class="hdlist1">
606 <em>import</em>
607 </dt>
608 <dt class="hdlist1">
609 <em>connect</em>
610 </dt>
611 <dd>
613 This helper supports the corresponding command with the same name.
614 </p>
615 </dd>
616 <dt class="hdlist1">
617 <em>refspec</em> <em>spec</em>
618 </dt>
619 <dd>
621 When using the import command, expect the source ref to have
622 been written to the destination ref. The earliest applicable
623 refspec takes precedence. For example
624 "refs/heads/<strong>:refs/svn/origin/branches/</strong>" means that, after an
625 "import refs/heads/name", the script has written to
626 refs/svn/origin/branches/name. If this capability is used at
627 all, it must cover all refs reported by the list command; if
628 it is not used, it is effectively "<strong>:</strong>"
629 </p>
630 </dd>
631 </dl></div>
632 </div>
633 <h2 id="_ref_list_attributes">REF LIST ATTRIBUTES</h2>
634 <div class="sectionbody">
635 <div class="dlist"><dl>
636 <dt class="hdlist1">
637 <em>for-push</em>
638 </dt>
639 <dd>
641 The caller wants to use the ref list to prepare push
642 commands. A helper might chose to acquire the ref list by
643 opening a different type of connection to the destination.
644 </p>
645 </dd>
646 <dt class="hdlist1">
647 <em>unchanged</em>
648 </dt>
649 <dd>
651 This ref is unchanged since the last import or fetch, although
652 the helper cannot necessarily determine what value that produced.
653 </p>
654 </dd>
655 </dl></div>
656 </div>
657 <h2 id="_options">OPTIONS</h2>
658 <div class="sectionbody">
659 <div class="dlist"><dl>
660 <dt class="hdlist1">
661 <em>option verbosity</em> &lt;n&gt;
662 </dt>
663 <dd>
665 Changes the verbosity of messages displayed by the helper.
666 A value of 0 for &lt;n&gt; means that processes operate
667 quietly, and the helper produces only error output.
668 1 is the default level of verbosity, and higher values
669 of &lt;n&gt; correspond to the number of -v flags passed on the
670 command line.
671 </p>
672 </dd>
673 <dt class="hdlist1">
674 <em>option progress</em> {<em>true</em>|<em>false</em>}
675 </dt>
676 <dd>
678 Enables (or disables) progress messages displayed by the
679 transport helper during a command.
680 </p>
681 </dd>
682 <dt class="hdlist1">
683 <em>option depth</em> &lt;depth&gt;
684 </dt>
685 <dd>
687 Deepens the history of a shallow repository.
688 </p>
689 </dd>
690 <dt class="hdlist1">
691 <em>option followtags</em> {<em>true</em>|<em>false</em>}
692 </dt>
693 <dd>
695 If enabled the helper should automatically fetch annotated
696 tag objects if the object the tag points at was transferred
697 during the fetch command. If the tag is not fetched by
698 the helper a second fetch command will usually be sent to
699 ask for the tag specifically. Some helpers may be able to
700 use this option to avoid a second network connection.
701 </p>
702 </dd>
703 </dl></div>
704 <div class="paragraph"><p><em>option dry-run</em> {<em>true</em>|<em>false</em>}:
705 If true, pretend the operation completed successfully,
706 but don&#8217;t actually change any repository data. For most
707 helpers this only applies to the <em>push</em>, if supported.</p></div>
708 <div class="dlist"><dl>
709 <dt class="hdlist1">
710 <em>option servpath &lt;c-style-quoted-path&gt;</em>
711 </dt>
712 <dd>
714 Sets service path (--upload-pack, --receive-pack etc.) for
715 next connect. Remote helper may support this option, but
716 must not rely on this option being set before
717 connect request occurs.
718 </p>
719 </dd>
720 </dl></div>
721 </div>
722 <h2 id="_see_also">SEE ALSO</h2>
723 <div class="sectionbody">
724 <div class="paragraph"><p><a href="git-remote.html">git-remote(1)</a></p></div>
725 </div>
726 <h2 id="_git">GIT</h2>
727 <div class="sectionbody">
728 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
729 </div>
730 <div id="footer">
731 <div id="footer-text">
732 Last updated 2011-03-15 23:30:14 UTC
733 </div>
734 </div>
735 </body>
736 </html>