Autogenerated HTML docs for v1.7.7-237-g34c44
[git/jnareb-git.git] / git-remote-helpers.html
blob7b66a7bb4ca13c90c734455d0f48b73b4205c725
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.5.2" />
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.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-remote-helpers(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-remote-helpers -
578 Helper programs to interact with remote repositories
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git remote-&lt;transport&gt;</em> &lt;repository&gt; [&lt;URL&gt;]</div>
587 <div class="verseblock-attribution">
588 </div></div>
589 </div>
590 <h2 id="_description">DESCRIPTION</h2>
591 <div class="sectionbody">
592 <div class="paragraph"><p>Remote helper programs are normally not used directly by end users,
593 but they are invoked by git when it needs to interact with remote
594 repositories git does not support natively. A given helper will
595 implement a subset of the capabilities documented here. When git
596 needs to interact with a repository using a remote helper, it spawns
597 the helper as an independent process, sends commands to the helper&#8217;s
598 standard input, and expects results from the helper&#8217;s standard
599 output. Because a remote helper runs as an independent process from
600 git, there is no need to re-link git to add a new helper, nor any
601 need to link the helper with the implementation of git.</p></div>
602 <div class="paragraph"><p>Every helper must support the "capabilities" command, which git
603 uses to determine what other commands the helper will accept. Those
604 other commands can be used to discover and update remote refs,
605 transport objects between the object database and the remote repository,
606 and update the local object store.</p></div>
607 <div class="paragraph"><p>Git comes with a "curl" family of remote helpers, that handle various
608 transport protocols, such as <em>git-remote-http</em>, <em>git-remote-https</em>,
609 <em>git-remote-ftp</em> and <em>git-remote-ftps</em>. They implement the capabilities
610 <em>fetch</em>, <em>option</em>, and <em>push</em>.</p></div>
611 </div>
612 <h2 id="_input_format">INPUT FORMAT</h2>
613 <div class="sectionbody">
614 <div class="paragraph"><p>Git sends the remote helper a list of commands on standard input, one
615 per line. The first command is always the <em>capabilities</em> command, in
616 response to which the remote helper must print a list of the
617 capabilities it supports (see below) followed by a blank line. The
618 response to the capabilities command determines what commands Git uses
619 in the remainder of the command stream.</p></div>
620 <div class="paragraph"><p>The command stream is terminated by a blank line. In some cases
621 (indicated in the documentation of the relevant commands), this blank
622 line is followed by a payload in some other protocol (e.g., the pack
623 protocol), while in others it indicates the end of input.</p></div>
624 <h3 id="_capabilities">Capabilities</h3><div style="clear:left"></div>
625 <div class="paragraph"><p>Each remote helper is expected to support only a subset of commands.
626 The operations a helper supports are declared to git in the response
627 to the <tt>capabilities</tt> command (see COMMANDS, below).</p></div>
628 <div class="dlist"><dl>
629 <dt class="hdlist1">
630 <em>option</em>
631 </dt>
632 <dd>
634 For specifying settings like <tt>verbosity</tt> (how much output to
635 write to stderr) and <tt>depth</tt> (how much history is wanted in the
636 case of a shallow clone) that affect how other commands are
637 carried out.
638 </p>
639 </dd>
640 <dt class="hdlist1">
641 <em>connect</em>
642 </dt>
643 <dd>
645 For fetching and pushing using git&#8217;s native packfile protocol
646 that requires a bidirectional, full-duplex connection.
647 </p>
648 </dd>
649 <dt class="hdlist1">
650 <em>push</em>
651 </dt>
652 <dd>
654 For listing remote refs and pushing specified objects from the
655 local object store to remote refs.
656 </p>
657 </dd>
658 <dt class="hdlist1">
659 <em>fetch</em>
660 </dt>
661 <dd>
663 For listing remote refs and fetching the associated history to
664 the local object store.
665 </p>
666 </dd>
667 <dt class="hdlist1">
668 <em>import</em>
669 </dt>
670 <dd>
672 For listing remote refs and fetching the associated history as
673 a fast-import stream.
674 </p>
675 </dd>
676 <dt class="hdlist1">
677 <em>refspec</em> &lt;refspec&gt;
678 </dt>
679 <dd>
681 This modifies the <em>import</em> capability, allowing the produced
682 fast-import stream to modify refs in a private namespace
683 instead of writing to refs/heads or refs/remotes directly.
684 It is recommended that all importers providing the <em>import</em>
685 capability use this.
686 </p>
687 <div class="paragraph"><p>A helper advertising the capability
688 <tt>refspec refs/heads/&#42;:refs/svn/origin/branches/&#42;</tt>
689 is saying that, when it is asked to <tt>import refs/heads/topic</tt>, the
690 stream it outputs will update the <tt>refs/svn/origin/branches/topic</tt>
691 ref.</p></div>
692 <div class="paragraph"><p>This capability can be advertised multiple times. The first
693 applicable refspec takes precedence. The left-hand of refspecs
694 advertised with this capability must cover all refs reported by
695 the list command. If no <em>refspec</em> capability is advertised,
696 there is an implied <tt>refspec &#42;:&#42;</tt>.</p></div>
697 </dd>
698 </dl></div>
699 <h3 id="_capabilities_for_pushing">Capabilities for Pushing</h3><div style="clear:left"></div>
700 <div class="dlist"><dl>
701 <dt class="hdlist1">
702 <em>connect</em>
703 </dt>
704 <dd>
706 Can attempt to connect to <em>git receive-pack</em> (for pushing),
707 <em>git upload-pack</em>, etc for communication using the
708 packfile protocol.
709 </p>
710 <div class="paragraph"><p>Supported commands: <em>connect</em>.</p></div>
711 </dd>
712 <dt class="hdlist1">
713 <em>push</em>
714 </dt>
715 <dd>
717 Can discover remote refs and push local commits and the
718 history leading up to them to new or existing remote refs.
719 </p>
720 <div class="paragraph"><p>Supported commands: <em>list for-push</em>, <em>push</em>.</p></div>
721 </dd>
722 </dl></div>
723 <div class="paragraph"><p>If a helper advertises both <em>connect</em> and <em>push</em>, git will use
724 <em>connect</em> if possible and fall back to <em>push</em> if the helper requests
725 so when connecting (see the <em>connect</em> command under COMMANDS).</p></div>
726 <h3 id="_capabilities_for_fetching">Capabilities for Fetching</h3><div style="clear:left"></div>
727 <div class="dlist"><dl>
728 <dt class="hdlist1">
729 <em>connect</em>
730 </dt>
731 <dd>
733 Can try to connect to <em>git upload-pack</em> (for fetching),
734 <em>git receive-pack</em>, etc for communication using the
735 packfile protocol.
736 </p>
737 <div class="paragraph"><p>Supported commands: <em>connect</em>.</p></div>
738 </dd>
739 <dt class="hdlist1">
740 <em>fetch</em>
741 </dt>
742 <dd>
744 Can discover remote refs and transfer objects reachable from
745 them to the local object store.
746 </p>
747 <div class="paragraph"><p>Supported commands: <em>list</em>, <em>fetch</em>.</p></div>
748 </dd>
749 <dt class="hdlist1">
750 <em>import</em>
751 </dt>
752 <dd>
754 Can discover remote refs and output objects reachable from
755 them as a stream in fast-import format.
756 </p>
757 <div class="paragraph"><p>Supported commands: <em>list</em>, <em>import</em>.</p></div>
758 </dd>
759 </dl></div>
760 <div class="paragraph"><p>If a helper advertises <em>connect</em>, git will use it if possible and
761 fall back to another capability if the helper requests so when
762 connecting (see the <em>connect</em> command under COMMANDS).
763 When choosing between <em>fetch</em> and <em>import</em>, git prefers <em>fetch</em>.
764 Other frontends may have some other order of preference.</p></div>
765 <div class="dlist"><dl>
766 <dt class="hdlist1">
767 <em>refspec</em> &lt;refspec&gt;
768 </dt>
769 <dd>
771 This modifies the <em>import</em> capability.
772 </p>
773 <div class="paragraph"><p>A helper advertising
774 <tt>refspec refs/heads/&#42;:refs/svn/origin/branches/&#42;</tt>
775 in its capabilities is saying that, when it handles
776 <tt>import refs/heads/topic</tt>, the stream it outputs will update the
777 <tt>refs/svn/origin/branches/topic</tt> ref.</p></div>
778 <div class="paragraph"><p>This capability can be advertised multiple times. The first
779 applicable refspec takes precedence. The left-hand of refspecs
780 advertised with this capability must cover all refs reported by
781 the list command. If no <em>refspec</em> capability is advertised,
782 there is an implied <tt>refspec &#42;:&#42;</tt>.</p></div>
783 </dd>
784 </dl></div>
785 </div>
786 <h2 id="_invocation">INVOCATION</h2>
787 <div class="sectionbody">
788 <div class="paragraph"><p>Remote helper programs are invoked with one or (optionally) two
789 arguments. The first argument specifies a remote repository as in git;
790 it is either the name of a configured remote or a URL. The second
791 argument specifies a URL; it is usually of the form
792 <em>&lt;transport&gt;://&lt;address&gt;</em>, but any arbitrary string is possible.
793 The <em>GIT_DIR</em> environment variable is set up for the remote helper
794 and can be used to determine where to store additional data or from
795 which directory to invoke auxiliary git commands.</p></div>
796 <div class="paragraph"><p>When git encounters a URL of the form <em>&lt;transport&gt;://&lt;address&gt;</em>, where
797 <em>&lt;transport&gt;</em> is a protocol that it cannot handle natively, it
798 automatically invokes <em>git remote-&lt;transport&gt;</em> with the full URL as
799 the second argument. If such a URL is encountered directly on the
800 command line, the first argument is the same as the second, and if it
801 is encountered in a configured remote, the first argument is the name
802 of that remote.</p></div>
803 <div class="paragraph"><p>A URL of the form <em>&lt;transport&gt;::&lt;address&gt;</em> explicitly instructs git to
804 invoke <em>git remote-&lt;transport&gt;</em> with <em>&lt;address&gt;</em> as the second
805 argument. If such a URL is encountered directly on the command line,
806 the first argument is <em>&lt;address&gt;</em>, and if it is encountered in a
807 configured remote, the first argument is the name of that remote.</p></div>
808 <div class="paragraph"><p>Additionally, when a configured remote has <em>remote.&lt;name&gt;.vcs</em> set to
809 <em>&lt;transport&gt;</em>, git explicitly invokes <em>git remote-&lt;transport&gt;</em> with
810 <em>&lt;name&gt;</em> as the first argument. If set, the second argument is
811 <em>remote.&lt;name&gt;.url</em>; otherwise, the second argument is omitted.</p></div>
812 </div>
813 <h2 id="_commands">COMMANDS</h2>
814 <div class="sectionbody">
815 <div class="paragraph"><p>Commands are given by the caller on the helper&#8217;s standard input, one per line.</p></div>
816 <div class="dlist"><dl>
817 <dt class="hdlist1">
818 <em>capabilities</em>
819 </dt>
820 <dd>
822 Lists the capabilities of the helper, one per line, ending
823 with a blank line. Each capability may be preceded with <em>*</em>,
824 which marks them mandatory for git version using the remote
825 helper to understand (unknown mandatory capability is fatal
826 error).
827 </p>
828 </dd>
829 <dt class="hdlist1">
830 <em>list</em>
831 </dt>
832 <dd>
834 Lists the refs, one per line, in the format "&lt;value&gt; &lt;name&gt;
835 [&lt;attr&gt; &#8230;]". The value may be a hex sha1 hash, "@&lt;dest&gt;" for
836 a symref, or "?" to indicate that the helper could not get the
837 value of the ref. A space-separated list of attributes follows
838 the name; unrecognized attributes are ignored. The list ends
839 with a blank line.
840 </p>
841 <div class="paragraph"><p>If <em>push</em> is supported this may be called as <em>list for-push</em>
842 to obtain the current refs prior to sending one or more <em>push</em>
843 commands to the helper.</p></div>
844 </dd>
845 <dt class="hdlist1">
846 <em>option</em> &lt;name&gt; &lt;value&gt;
847 </dt>
848 <dd>
850 Sets the transport helper option &lt;name&gt; to &lt;value&gt;. Outputs a
851 single line containing one of <em>ok</em> (option successfully set),
852 <em>unsupported</em> (option not recognized) or <em>error &lt;msg&gt;</em>
853 (option &lt;name&gt; is supported but &lt;value&gt; is not valid
854 for it). Options should be set before other commands,
855 and may influence the behavior of those commands.
856 </p>
857 <div class="paragraph"><p>Supported if the helper has the "option" capability.</p></div>
858 </dd>
859 <dt class="hdlist1">
860 <em>fetch</em> &lt;sha1&gt; &lt;name&gt;
861 </dt>
862 <dd>
864 Fetches the given object, writing the necessary objects
865 to the database. Fetch commands are sent in a batch, one
866 per line, terminated with a blank line.
867 Outputs a single blank line when all fetch commands in the
868 same batch are complete. Only objects which were reported
869 in the ref list with a sha1 may be fetched this way.
870 </p>
871 <div class="paragraph"><p>Optionally may output a <em>lock &lt;file&gt;</em> line indicating a file under
872 GIT_DIR/objects/pack which is keeping a pack until refs can be
873 suitably updated.</p></div>
874 <div class="paragraph"><p>Supported if the helper has the "fetch" capability.</p></div>
875 </dd>
876 <dt class="hdlist1">
877 <em>push</em> +&lt;src&gt;:&lt;dst&gt;
878 </dt>
879 <dd>
881 Pushes the given local &lt;src&gt; commit or branch to the
882 remote branch described by &lt;dst&gt;. A batch sequence of
883 one or more <em>push</em> commands is terminated with a blank line
884 (if there is only one reference to push, a single <em>push</em> command
885 is followed by a blank line). For example, the following would
886 be two batches of <em>push</em>, the first asking the remote-helper
887 to push the local ref <em>master</em> to the remote ref <em>master</em> and
888 the local <em>HEAD</em> to the remote <em>branch</em>, and the second
889 asking to push ref <em>foo</em> to ref <em>bar</em> (forced update requested
890 by the <em>+</em>).
891 </p>
892 <div class="listingblock">
893 <div class="content">
894 <pre><tt>push refs/heads/master:refs/heads/master
895 push HEAD:refs/heads/branch
897 push +refs/heads/foo:refs/heads/bar
898 \n</tt></pre>
899 </div></div>
900 <div class="paragraph"><p>Zero or more protocol options may be entered after the last <em>push</em>
901 command, before the batch&#8217;s terminating blank line.</p></div>
902 <div class="paragraph"><p>When the push is complete, outputs one or more <em>ok &lt;dst&gt;</em> or
903 <em>error &lt;dst&gt; &lt;why&gt;?</em> lines to indicate success or failure of
904 each pushed ref. The status report output is terminated by
905 a blank line. The option field &lt;why&gt; may be quoted in a C
906 style string if it contains an LF.</p></div>
907 <div class="paragraph"><p>Supported if the helper has the "push" capability.</p></div>
908 </dd>
909 <dt class="hdlist1">
910 <em>import</em> &lt;name&gt;
911 </dt>
912 <dd>
914 Produces a fast-import stream which imports the current value
915 of the named ref. It may additionally import other refs as
916 needed to construct the history efficiently. The script writes
917 to a helper-specific private namespace. The value of the named
918 ref should be written to a location in this namespace derived
919 by applying the refspecs from the "refspec" capability to the
920 name of the ref.
921 </p>
922 <div class="paragraph"><p>Especially useful for interoperability with a foreign versioning
923 system.</p></div>
924 <div class="paragraph"><p>Just like <em>push</em>, a batch sequence of one or more <em>import</em> is
925 terminated with a blank line. For each batch of <em>import</em>, the remote
926 helper should produce a fast-import stream terminated by a <em>done</em>
927 command.</p></div>
928 <div class="paragraph"><p>Supported if the helper has the "import" capability.</p></div>
929 </dd>
930 <dt class="hdlist1">
931 <em>connect</em> &lt;service&gt;
932 </dt>
933 <dd>
935 Connects to given service. Standard input and standard output
936 of helper are connected to specified service (git prefix is
937 included in service name so e.g. fetching uses <em>git-upload-pack</em>
938 as service) on remote side. Valid replies to this command are
939 empty line (connection established), <em>fallback</em> (no smart
940 transport support, fall back to dumb transports) and just
941 exiting with error message printed (can&#8217;t connect, don&#8217;t
942 bother trying to fall back). After line feed terminating the
943 positive (empty) response, the output of service starts. After
944 the connection ends, the remote helper exits.
945 </p>
946 <div class="paragraph"><p>Supported if the helper has the "connect" capability.</p></div>
947 </dd>
948 </dl></div>
949 <div class="paragraph"><p>If a fatal error occurs, the program writes the error message to
950 stderr and exits. The caller should expect that a suitable error
951 message has been printed if the child closes the connection without
952 completing a valid response for the current command.</p></div>
953 <div class="paragraph"><p>Additional commands may be supported, as may be determined from
954 capabilities reported by the helper.</p></div>
955 </div>
956 <h2 id="_ref_list_attributes">REF LIST ATTRIBUTES</h2>
957 <div class="sectionbody">
958 <div class="dlist"><dl>
959 <dt class="hdlist1">
960 <em>for-push</em>
961 </dt>
962 <dd>
964 The caller wants to use the ref list to prepare push
965 commands. A helper might chose to acquire the ref list by
966 opening a different type of connection to the destination.
967 </p>
968 </dd>
969 <dt class="hdlist1">
970 <em>unchanged</em>
971 </dt>
972 <dd>
974 This ref is unchanged since the last import or fetch, although
975 the helper cannot necessarily determine what value that produced.
976 </p>
977 </dd>
978 </dl></div>
979 </div>
980 <h2 id="_options">OPTIONS</h2>
981 <div class="sectionbody">
982 <div class="dlist"><dl>
983 <dt class="hdlist1">
984 <em>option verbosity</em> &lt;n&gt;
985 </dt>
986 <dd>
988 Changes the verbosity of messages displayed by the helper.
989 A value of 0 for &lt;n&gt; means that processes operate
990 quietly, and the helper produces only error output.
991 1 is the default level of verbosity, and higher values
992 of &lt;n&gt; correspond to the number of -v flags passed on the
993 command line.
994 </p>
995 </dd>
996 <dt class="hdlist1">
997 <em>option progress</em> {<em>true</em>|<em>false</em>}
998 </dt>
999 <dd>
1001 Enables (or disables) progress messages displayed by the
1002 transport helper during a command.
1003 </p>
1004 </dd>
1005 <dt class="hdlist1">
1006 <em>option depth</em> &lt;depth&gt;
1007 </dt>
1008 <dd>
1010 Deepens the history of a shallow repository.
1011 </p>
1012 </dd>
1013 <dt class="hdlist1">
1014 <em>option followtags</em> {<em>true</em>|<em>false</em>}
1015 </dt>
1016 <dd>
1018 If enabled the helper should automatically fetch annotated
1019 tag objects if the object the tag points at was transferred
1020 during the fetch command. If the tag is not fetched by
1021 the helper a second fetch command will usually be sent to
1022 ask for the tag specifically. Some helpers may be able to
1023 use this option to avoid a second network connection.
1024 </p>
1025 </dd>
1026 </dl></div>
1027 <div class="paragraph"><p><em>option dry-run</em> {<em>true</em>|<em>false</em>}:
1028 If true, pretend the operation completed successfully,
1029 but don&#8217;t actually change any repository data. For most
1030 helpers this only applies to the <em>push</em>, if supported.</p></div>
1031 <div class="dlist"><dl>
1032 <dt class="hdlist1">
1033 <em>option servpath &lt;c-style-quoted-path&gt;</em>
1034 </dt>
1035 <dd>
1037 Sets service path (--upload-pack, --receive-pack etc.) for
1038 next connect. Remote helper may support this option, but
1039 must not rely on this option being set before
1040 connect request occurs.
1041 </p>
1042 </dd>
1043 </dl></div>
1044 </div>
1045 <h2 id="_see_also">SEE ALSO</h2>
1046 <div class="sectionbody">
1047 <div class="paragraph"><p><a href="git-remote.html">git-remote(1)</a></p></div>
1048 <div class="paragraph"><p><a href="git-remote-testgit.html">git-remote-testgit(1)</a></p></div>
1049 </div>
1050 <h2 id="_git">GIT</h2>
1051 <div class="sectionbody">
1052 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1053 </div>
1054 </div>
1055 <div id="footnotes"><hr /></div>
1056 <div id="footer">
1057 <div id="footer-text">
1058 Last updated 2011-09-21 23:01:14 PDT
1059 </div>
1060 </div>
1061 </body>
1062 </html>