Autogenerated HTML docs for v1.7.6-396-ge0613
[git/jnareb-git.git] / git-remote-helpers.html
blob85bf0804295fe4e3c877c05a0dbfb564148ab773
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="verseblock">
418 <div class="verseblock-content"><em>git remote-&lt;transport&gt;</em> &lt;repository&gt; [&lt;URL&gt;]</div>
419 <div class="verseblock-attribution">
420 </div></div>
421 </div>
422 <h2 id="_description">DESCRIPTION</h2>
423 <div class="sectionbody">
424 <div class="paragraph"><p>Remote helper programs are normally not used directly by end users,
425 but they are invoked by git when it needs to interact with remote
426 repositories git does not support natively. A given helper will
427 implement a subset of the capabilities documented here. When git
428 needs to interact with a repository using a remote helper, it spawns
429 the helper as an independent process, sends commands to the helper&#8217;s
430 standard input, and expects results from the helper&#8217;s standard
431 output. Because a remote helper runs as an independent process from
432 git, there is no need to re-link git to add a new helper, nor any
433 need to link the helper with the implementation of git.</p></div>
434 <div class="paragraph"><p>Every helper must support the "capabilities" command, which git will
435 use to determine what other commands the helper will accept. Other
436 commands generally concern facilities like discovering and updating
437 remote refs, transporting objects between the object database and
438 the remote repository, and updating the local object store.</p></div>
439 <div class="paragraph"><p>Helpers supporting the <em>fetch</em> capability can discover refs from the
440 remote repository and transfer objects reachable from those refs to
441 the local object store. Helpers supporting the <em>push</em> capability can
442 transfer local objects to the remote repository and update remote refs.</p></div>
443 <div class="paragraph"><p>Git comes with a "curl" family of remote helpers, that handle various
444 transport protocols, such as <em>git-remote-http</em>, <em>git-remote-https</em>,
445 <em>git-remote-ftp</em> and <em>git-remote-ftps</em>. They implement the capabilities
446 <em>fetch</em>, <em>option</em>, and <em>push</em>.</p></div>
447 </div>
448 <h2 id="_invocation">INVOCATION</h2>
449 <div class="sectionbody">
450 <div class="paragraph"><p>Remote helper programs are invoked with one or (optionally) two
451 arguments. The first argument specifies a remote repository as in git;
452 it is either the name of a configured remote or a URL. The second
453 argument specifies a URL; it is usually of the form
454 <em>&lt;transport&gt;://&lt;address&gt;</em>, but any arbitrary string is possible.
455 The <em>GIT_DIR</em> environment variable is set up for the remote helper
456 and can be used to determine where to store additional data or from
457 which directory to invoke auxiliary git commands.</p></div>
458 <div class="paragraph"><p>When git encounters a URL of the form <em>&lt;transport&gt;://&lt;address&gt;</em>, where
459 <em>&lt;transport&gt;</em> is a protocol that it cannot handle natively, it
460 automatically invokes <em>git remote-&lt;transport&gt;</em> with the full URL as
461 the second argument. If such a URL is encountered directly on the
462 command line, the first argument is the same as the second, and if it
463 is encountered in a configured remote, the first argument is the name
464 of that remote.</p></div>
465 <div class="paragraph"><p>A URL of the form <em>&lt;transport&gt;::&lt;address&gt;</em> explicitly instructs git to
466 invoke <em>git remote-&lt;transport&gt;</em> with <em>&lt;address&gt;</em> as the second
467 argument. If such a URL is encountered directly on the command line,
468 the first argument is <em>&lt;address&gt;</em>, and if it is encountered in a
469 configured remote, the first argument is the name of that remote.</p></div>
470 <div class="paragraph"><p>Additionally, when a configured remote has <em>remote.&lt;name&gt;.vcs</em> set to
471 <em>&lt;transport&gt;</em>, git explicitly invokes <em>git remote-&lt;transport&gt;</em> with
472 <em>&lt;name&gt;</em> as the first argument. If set, the second argument is
473 <em>remote.&lt;name&gt;.url</em>; otherwise, the second argument is omitted.</p></div>
474 </div>
475 <h2 id="_commands">COMMANDS</h2>
476 <div class="sectionbody">
477 <div class="paragraph"><p>Commands are given by the caller on the helper&#8217;s standard input, one per line.</p></div>
478 <div class="dlist"><dl>
479 <dt class="hdlist1">
480 <em>capabilities</em>
481 </dt>
482 <dd>
484 Lists the capabilities of the helper, one per line, ending
485 with a blank line. Each capability may be preceded with <em>*</em>,
486 which marks them mandatory for git version using the remote
487 helper to understand (unknown mandatory capability is fatal
488 error).
489 </p>
490 </dd>
491 <dt class="hdlist1">
492 <em>list</em>
493 </dt>
494 <dd>
496 Lists the refs, one per line, in the format "&lt;value&gt; &lt;name&gt;
497 [&lt;attr&gt; &#8230;]". The value may be a hex sha1 hash, "@&lt;dest&gt;" for
498 a symref, or "?" to indicate that the helper could not get the
499 value of the ref. A space-separated list of attributes follows
500 the name; unrecognized attributes are ignored. The list ends
501 with a blank line.
502 </p>
503 <div class="paragraph"><p>If <em>push</em> is supported this may be called as <em>list for-push</em>
504 to obtain the current refs prior to sending one or more <em>push</em>
505 commands to the helper.</p></div>
506 </dd>
507 <dt class="hdlist1">
508 <em>option</em> &lt;name&gt; &lt;value&gt;
509 </dt>
510 <dd>
512 Sets the transport helper option &lt;name&gt; to &lt;value&gt;. Outputs a
513 single line containing one of <em>ok</em> (option successfully set),
514 <em>unsupported</em> (option not recognized) or <em>error &lt;msg&gt;</em>
515 (option &lt;name&gt; is supported but &lt;value&gt; is not valid
516 for it). Options should be set before other commands,
517 and may influence the behavior of those commands.
518 </p>
519 <div class="paragraph"><p>Supported if the helper has the "option" capability.</p></div>
520 </dd>
521 <dt class="hdlist1">
522 <em>fetch</em> &lt;sha1&gt; &lt;name&gt;
523 </dt>
524 <dd>
526 Fetches the given object, writing the necessary objects
527 to the database. Fetch commands are sent in a batch, one
528 per line, terminated with a blank line.
529 Outputs a single blank line when all fetch commands in the
530 same batch are complete. Only objects which were reported
531 in the ref list with a sha1 may be fetched this way.
532 </p>
533 <div class="paragraph"><p>Optionally may output a <em>lock &lt;file&gt;</em> line indicating a file under
534 GIT_DIR/objects/pack which is keeping a pack until refs can be
535 suitably updated.</p></div>
536 <div class="paragraph"><p>Supported if the helper has the "fetch" capability.</p></div>
537 </dd>
538 <dt class="hdlist1">
539 <em>push</em> +&lt;src&gt;:&lt;dst&gt;
540 </dt>
541 <dd>
543 Pushes the given local &lt;src&gt; commit or branch to the
544 remote branch described by &lt;dst&gt;. A batch sequence of
545 one or more push commands is terminated with a blank line.
546 </p>
547 <div class="paragraph"><p>Zero or more protocol options may be entered after the last <em>push</em>
548 command, before the batch&#8217;s terminating blank line.</p></div>
549 <div class="paragraph"><p>When the push is complete, outputs one or more <em>ok &lt;dst&gt;</em> or
550 <em>error &lt;dst&gt; &lt;why&gt;?</em> lines to indicate success or failure of
551 each pushed ref. The status report output is terminated by
552 a blank line. The option field &lt;why&gt; may be quoted in a C
553 style string if it contains an LF.</p></div>
554 <div class="paragraph"><p>Supported if the helper has the "push" capability.</p></div>
555 </dd>
556 <dt class="hdlist1">
557 <em>import</em> &lt;name&gt;
558 </dt>
559 <dd>
561 Produces a fast-import stream which imports the current value
562 of the named ref. It may additionally import other refs as
563 needed to construct the history efficiently. The script writes
564 to a helper-specific private namespace. The value of the named
565 ref should be written to a location in this namespace derived
566 by applying the refspecs from the "refspec" capability to the
567 name of the ref.
568 </p>
569 <div class="paragraph"><p>Especially useful for interoperability with a foreign versioning
570 system.</p></div>
571 <div class="paragraph"><p>Supported if the helper has the "import" capability.</p></div>
572 </dd>
573 <dt class="hdlist1">
574 <em>connect</em> &lt;service&gt;
575 </dt>
576 <dd>
578 Connects to given service. Standard input and standard output
579 of helper are connected to specified service (git prefix is
580 included in service name so e.g. fetching uses <em>git-upload-pack</em>
581 as service) on remote side. Valid replies to this command are
582 empty line (connection established), <em>fallback</em> (no smart
583 transport support, fall back to dumb transports) and just
584 exiting with error message printed (can&#8217;t connect, don&#8217;t
585 bother trying to fall back). After line feed terminating the
586 positive (empty) response, the output of service starts. After
587 the connection ends, the remote helper exits.
588 </p>
589 <div class="paragraph"><p>Supported if the helper has the "connect" capability.</p></div>
590 </dd>
591 </dl></div>
592 <div class="paragraph"><p>If a fatal error occurs, the program writes the error message to
593 stderr and exits. The caller should expect that a suitable error
594 message has been printed if the child closes the connection without
595 completing a valid response for the current command.</p></div>
596 <div class="paragraph"><p>Additional commands may be supported, as may be determined from
597 capabilities reported by the helper.</p></div>
598 </div>
599 <h2 id="_capabilities">CAPABILITIES</h2>
600 <div class="sectionbody">
601 <div class="dlist"><dl>
602 <dt class="hdlist1">
603 <em>fetch</em>
604 </dt>
605 <dt class="hdlist1">
606 <em>option</em>
607 </dt>
608 <dt class="hdlist1">
609 <em>push</em>
610 </dt>
611 <dt class="hdlist1">
612 <em>import</em>
613 </dt>
614 <dt class="hdlist1">
615 <em>connect</em>
616 </dt>
617 <dd>
619 This helper supports the corresponding command with the same name.
620 </p>
621 </dd>
622 <dt class="hdlist1">
623 <em>refspec</em> <em>spec</em>
624 </dt>
625 <dd>
627 When using the import command, expect the source ref to have
628 been written to the destination ref. The earliest applicable
629 refspec takes precedence. For example
630 "refs/heads/&#42;:refs/svn/origin/branches/&#42;" means
631 that, after an "import refs/heads/name", the script has written to
632 refs/svn/origin/branches/name. If this capability is used at
633 all, it must cover all refs reported by the list command; if
634 it is not used, it is effectively "&#42;:&#42;"
635 </p>
636 </dd>
637 </dl></div>
638 </div>
639 <h2 id="_ref_list_attributes">REF LIST ATTRIBUTES</h2>
640 <div class="sectionbody">
641 <div class="dlist"><dl>
642 <dt class="hdlist1">
643 <em>for-push</em>
644 </dt>
645 <dd>
647 The caller wants to use the ref list to prepare push
648 commands. A helper might chose to acquire the ref list by
649 opening a different type of connection to the destination.
650 </p>
651 </dd>
652 <dt class="hdlist1">
653 <em>unchanged</em>
654 </dt>
655 <dd>
657 This ref is unchanged since the last import or fetch, although
658 the helper cannot necessarily determine what value that produced.
659 </p>
660 </dd>
661 </dl></div>
662 </div>
663 <h2 id="_options">OPTIONS</h2>
664 <div class="sectionbody">
665 <div class="dlist"><dl>
666 <dt class="hdlist1">
667 <em>option verbosity</em> &lt;n&gt;
668 </dt>
669 <dd>
671 Changes the verbosity of messages displayed by the helper.
672 A value of 0 for &lt;n&gt; means that processes operate
673 quietly, and the helper produces only error output.
674 1 is the default level of verbosity, and higher values
675 of &lt;n&gt; correspond to the number of -v flags passed on the
676 command line.
677 </p>
678 </dd>
679 <dt class="hdlist1">
680 <em>option progress</em> {<em>true</em>|<em>false</em>}
681 </dt>
682 <dd>
684 Enables (or disables) progress messages displayed by the
685 transport helper during a command.
686 </p>
687 </dd>
688 <dt class="hdlist1">
689 <em>option depth</em> &lt;depth&gt;
690 </dt>
691 <dd>
693 Deepens the history of a shallow repository.
694 </p>
695 </dd>
696 <dt class="hdlist1">
697 <em>option followtags</em> {<em>true</em>|<em>false</em>}
698 </dt>
699 <dd>
701 If enabled the helper should automatically fetch annotated
702 tag objects if the object the tag points at was transferred
703 during the fetch command. If the tag is not fetched by
704 the helper a second fetch command will usually be sent to
705 ask for the tag specifically. Some helpers may be able to
706 use this option to avoid a second network connection.
707 </p>
708 </dd>
709 </dl></div>
710 <div class="paragraph"><p><em>option dry-run</em> {<em>true</em>|<em>false</em>}:
711 If true, pretend the operation completed successfully,
712 but don&#8217;t actually change any repository data. For most
713 helpers this only applies to the <em>push</em>, if supported.</p></div>
714 <div class="dlist"><dl>
715 <dt class="hdlist1">
716 <em>option servpath &lt;c-style-quoted-path&gt;</em>
717 </dt>
718 <dd>
720 Sets service path (--upload-pack, --receive-pack etc.) for
721 next connect. Remote helper may support this option, but
722 must not rely on this option being set before
723 connect request occurs.
724 </p>
725 </dd>
726 </dl></div>
727 </div>
728 <h2 id="_see_also">SEE ALSO</h2>
729 <div class="sectionbody">
730 <div class="paragraph"><p><a href="git-remote.html">git-remote(1)</a></p></div>
731 </div>
732 <h2 id="_git">GIT</h2>
733 <div class="sectionbody">
734 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
735 </div>
736 <div id="footer">
737 <div id="footer-text">
738 Last updated 2011-08-02 00:08:47 UTC
739 </div>
740 </div>
741 </body>
742 </html>