Autogenerated HTML docs for v1.7.3.3-402-ga48aa
[git/jnareb-git.git] / git-remote-helpers.html
blob863d5a4cbffb4f79e79cb2394ac9bea452c2670b
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.2.5" />
7 <style type="text/css">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-remote-helpers(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-remote-helpers(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-remote-helpers -
317 Helper programs to interact with remote repositories
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="para"><p><em>git remote-&lt;transport&gt;</em> &lt;repository&gt; [&lt;URL&gt;]</p></div>
324 </div>
325 <h2 id="_description">DESCRIPTION</h2>
326 <div class="sectionbody">
327 <div class="para"><p>Remote helper programs are normally not used directly by end users,
328 but they are invoked by git when it needs to interact with remote
329 repositories git does not support natively. A given helper will
330 implement a subset of the capabilities documented here. When git
331 needs to interact with a repository using a remote helper, it spawns
332 the helper as an independent process, sends commands to the helper's
333 standard input, and expects results from the helper's standard
334 output. Because a remote helper runs as an independent process from
335 git, there is no need to re-link git to add a new helper, nor any
336 need to link the helper with the implementation of git.</p></div>
337 <div class="para"><p>Every helper must support the "capabilities" command, which git will
338 use to determine what other commands the helper will accept. Other
339 commands generally concern facilities like discovering and updating
340 remote refs, transporting objects between the object database and
341 the remote repository, and updating the local object store.</p></div>
342 <div class="para"><p>Helpers supporting the <em>fetch</em> capability can discover refs from the
343 remote repository and transfer objects reachable from those refs to
344 the local object store. Helpers supporting the <em>push</em> capability can
345 transfer local objects to the remote repository and update remote refs.</p></div>
346 <div class="para"><p>Git comes with a "curl" family of remote helpers, that handle various
347 transport protocols, such as <em>git-remote-http</em>, <em>git-remote-https</em>,
348 <em>git-remote-ftp</em> and <em>git-remote-ftps</em>. They implement the capabilities
349 <em>fetch</em>, <em>option</em>, and <em>push</em>.</p></div>
350 </div>
351 <h2 id="_invocation">INVOCATION</h2>
352 <div class="sectionbody">
353 <div class="para"><p>Remote helper programs are invoked with one or (optionally) two
354 arguments. The first argument specifies a remote repository as in git;
355 it is either the name of a configured remote or a URL. The second
356 argument specifies a URL; it is usually of the form
357 <em>&lt;transport&gt;://&lt;address&gt;</em>, but any arbitrary string is possible.</p></div>
358 <div class="para"><p>When git encounters a URL of the form <em>&lt;transport&gt;://&lt;address&gt;</em>, where
359 <em>&lt;transport&gt;</em> is a protocol that it cannot handle natively, it
360 automatically invokes <em>git remote-&lt;transport&gt;</em> with the full URL as
361 the second argument. If such a URL is encountered directly on the
362 command line, the first argument is the same as the second, and if it
363 is encountered in a configured remote, the first argument is the name
364 of that remote.</p></div>
365 <div class="para"><p>A URL of the form <em>&lt;transport&gt;::&lt;address&gt;</em> explicitly instructs git to
366 invoke <em>git remote-&lt;transport&gt;</em> with <em>&lt;address&gt;</em> as the second
367 argument. If such a URL is encountered directly on the command line,
368 the first argument is <em>&lt;address&gt;</em>, and if it is encountered in a
369 configured remote, the first argument is the name of that remote.</p></div>
370 <div class="para"><p>Additionally, when a configured remote has <em>remote.&lt;name&gt;.vcs</em> set to
371 <em>&lt;transport&gt;</em>, git explicitly invokes <em>git remote-&lt;transport&gt;</em> with
372 <em>&lt;name&gt;</em> as the first argument. If set, the second argument is
373 <em>remote.&lt;name&gt;.url</em>; otherwise, the second argument is omitted.</p></div>
374 </div>
375 <h2 id="_commands">COMMANDS</h2>
376 <div class="sectionbody">
377 <div class="para"><p>Commands are given by the caller on the helper's standard input, one per line.</p></div>
378 <div class="vlist"><dl>
379 <dt>
380 <em>capabilities</em>
381 </dt>
382 <dd>
384 Lists the capabilities of the helper, one per line, ending
385 with a blank line. Each capability may be preceded with <em>*</em>,
386 which marks them mandatory for git version using the remote
387 helper to understand (unknown mandatory capability is fatal
388 error).
389 </p>
390 </dd>
391 <dt>
392 <em>list</em>
393 </dt>
394 <dd>
396 Lists the refs, one per line, in the format "&lt;value&gt; &lt;name&gt;
397 [&lt;attr&gt; &#8230;]". The value may be a hex sha1 hash, "@&lt;dest&gt;" for
398 a symref, or "?" to indicate that the helper could not get the
399 value of the ref. A space-separated list of attributes follows
400 the name; unrecognized attributes are ignored. The list ends
401 with a blank line.
402 </p>
403 <div class="para"><p>If <em>push</em> is supported this may be called as <em>list for-push</em>
404 to obtain the current refs prior to sending one or more <em>push</em>
405 commands to the helper.</p></div>
406 </dd>
407 <dt>
408 <em>option</em> &lt;name&gt; &lt;value&gt;
409 </dt>
410 <dd>
412 Sets the transport helper option &lt;name&gt; to &lt;value&gt;. Outputs a
413 single line containing one of <em>ok</em> (option successfully set),
414 <em>unsupported</em> (option not recognized) or <em>error &lt;msg&gt;</em>
415 (option &lt;name&gt; is supported but &lt;value&gt; is not valid
416 for it). Options should be set before other commands,
417 and may influence the behavior of those commands.
418 </p>
419 <div class="para"><p>Supported if the helper has the "option" capability.</p></div>
420 </dd>
421 <dt>
422 <em>fetch</em> &lt;sha1&gt; &lt;name&gt;
423 </dt>
424 <dd>
426 Fetches the given object, writing the necessary objects
427 to the database. Fetch commands are sent in a batch, one
428 per line, terminated with a blank line.
429 Outputs a single blank line when all fetch commands in the
430 same batch are complete. Only objects which were reported
431 in the ref list with a sha1 may be fetched this way.
432 </p>
433 <div class="para"><p>Optionally may output a <em>lock &lt;file&gt;</em> line indicating a file under
434 GIT_DIR/objects/pack which is keeping a pack until refs can be
435 suitably updated.</p></div>
436 <div class="para"><p>Supported if the helper has the "fetch" capability.</p></div>
437 </dd>
438 <dt>
439 <em>push</em> +&lt;src&gt;:&lt;dst&gt;
440 </dt>
441 <dd>
443 Pushes the given local &lt;src&gt; commit or branch to the
444 remote branch described by &lt;dst&gt;. A batch sequence of
445 one or more push commands is terminated with a blank line.
446 </p>
447 <div class="para"><p>Zero or more protocol options may be entered after the last <em>push</em>
448 command, before the batch's terminating blank line.</p></div>
449 <div class="para"><p>When the push is complete, outputs one or more <em>ok &lt;dst&gt;</em> or
450 <em>error &lt;dst&gt; &lt;why&gt;?</em> lines to indicate success or failure of
451 each pushed ref. The status report output is terminated by
452 a blank line. The option field &lt;why&gt; may be quoted in a C
453 style string if it contains an LF.</p></div>
454 <div class="para"><p>Supported if the helper has the "push" capability.</p></div>
455 </dd>
456 <dt>
457 <em>import</em> &lt;name&gt;
458 </dt>
459 <dd>
461 Produces a fast-import stream which imports the current value
462 of the named ref. It may additionally import other refs as
463 needed to construct the history efficiently. The script writes
464 to a helper-specific private namespace. The value of the named
465 ref should be written to a location in this namespace derived
466 by applying the refspecs from the "refspec" capability to the
467 name of the ref.
468 </p>
469 <div class="para"><p>Especially useful for interoperability with a foreign versioning
470 system.</p></div>
471 <div class="para"><p>Supported if the helper has the "import" capability.</p></div>
472 </dd>
473 <dt>
474 <em>connect</em> &lt;service&gt;
475 </dt>
476 <dd>
478 Connects to given service. Standard input and standard output
479 of helper are connected to specified service (git prefix is
480 included in service name so e.g. fetching uses <em>git-upload-pack</em>
481 as service) on remote side. Valid replies to this command are
482 empty line (connection established), <em>fallback</em> (no smart
483 transport support, fall back to dumb transports) and just
484 exiting with error message printed (can't connect, don't
485 bother trying to fall back). After line feed terminating the
486 positive (empty) response, the output of service starts. After
487 the connection ends, the remote helper exits.
488 </p>
489 <div class="para"><p>Supported if the helper has the "connect" capability.</p></div>
490 </dd>
491 </dl></div>
492 <div class="para"><p>If a fatal error occurs, the program writes the error message to
493 stderr and exits. The caller should expect that a suitable error
494 message has been printed if the child closes the connection without
495 completing a valid response for the current command.</p></div>
496 <div class="para"><p>Additional commands may be supported, as may be determined from
497 capabilities reported by the helper.</p></div>
498 </div>
499 <h2 id="_capabilities">CAPABILITIES</h2>
500 <div class="sectionbody">
501 <div class="vlist"><dl>
502 <dt>
503 <em>fetch</em>
504 </dt>
505 <dt>
506 <em>option</em>
507 </dt>
508 <dt>
509 <em>push</em>
510 </dt>
511 <dt>
512 <em>import</em>
513 </dt>
514 <dt>
515 <em>connect</em>
516 </dt>
517 <dd>
519 This helper supports the corresponding command with the same name.
520 </p>
521 </dd>
522 <dt>
523 <em>refspec</em> <em>spec</em>
524 </dt>
525 <dd>
527 When using the import command, expect the source ref to have
528 been written to the destination ref. The earliest applicable
529 refspec takes precedence. For example
530 "refs/heads/<strong>:refs/svn/origin/branches/</strong>" means that, after an
531 "import refs/heads/name", the script has written to
532 refs/svn/origin/branches/name. If this capability is used at
533 all, it must cover all refs reported by the list command; if
534 it is not used, it is effectively "<strong>:</strong>"
535 </p>
536 </dd>
537 </dl></div>
538 </div>
539 <h2 id="_ref_list_attributes">REF LIST ATTRIBUTES</h2>
540 <div class="sectionbody">
541 <div class="vlist"><dl>
542 <dt>
543 <em>for-push</em>
544 </dt>
545 <dd>
547 The caller wants to use the ref list to prepare push
548 commands. A helper might chose to acquire the ref list by
549 opening a different type of connection to the destination.
550 </p>
551 </dd>
552 <dt>
553 <em>unchanged</em>
554 </dt>
555 <dd>
557 This ref is unchanged since the last import or fetch, although
558 the helper cannot necessarily determine what value that produced.
559 </p>
560 </dd>
561 </dl></div>
562 </div>
563 <h2 id="_options">OPTIONS</h2>
564 <div class="sectionbody">
565 <div class="vlist"><dl>
566 <dt>
567 <em>option verbosity</em> &lt;N&gt;
568 </dt>
569 <dd>
571 Changes the verbosity of messages displayed by the helper.
572 A value of 0 for N means that processes operate
573 quietly, and the helper produces only error output.
574 1 is the default level of verbosity, and higher values
575 of N correspond to the number of -v flags passed on the
576 command line.
577 </p>
578 </dd>
579 <dt>
580 <em>option progress</em> {<em>true</em>|<em>false</em>}
581 </dt>
582 <dd>
584 Enables (or disables) progress messages displayed by the
585 transport helper during a command.
586 </p>
587 </dd>
588 <dt>
589 <em>option depth</em> &lt;depth&gt;
590 </dt>
591 <dd>
593 Deepens the history of a shallow repository.
594 </p>
595 </dd>
596 <dt>
597 <em>option followtags</em> {<em>true</em>|<em>false</em>}
598 </dt>
599 <dd>
601 If enabled the helper should automatically fetch annotated
602 tag objects if the object the tag points at was transferred
603 during the fetch command. If the tag is not fetched by
604 the helper a second fetch command will usually be sent to
605 ask for the tag specifically. Some helpers may be able to
606 use this option to avoid a second network connection.
607 </p>
608 </dd>
609 </dl></div>
610 <div class="para"><p><em>option dry-run</em> {<em>true</em>|<em>false</em>}:
611 If true, pretend the operation completed successfully,
612 but don't actually change any repository data. For most
613 helpers this only applies to the <em>push</em>, if supported.</p></div>
614 <div class="vlist"><dl>
615 <dt>
616 <em>option servpath &lt;c-style-quoted-path&gt;</em>
617 </dt>
618 <dd>
620 Sets service path (--upload-pack, --receive-pack etc.) for
621 next connect. Remote helper may support this option, but
622 must not rely on this option being set before
623 connect request occurs.
624 </p>
625 </dd>
626 </dl></div>
627 </div>
628 <h2 id="_see_also">SEE ALSO</h2>
629 <div class="sectionbody">
630 <div class="para"><p><a href="git-remote.html">git-remote(1)</a></p></div>
631 </div>
632 <h2 id="_documentation">Documentation</h2>
633 <div class="sectionbody">
634 <div class="para"><p>Documentation by Daniel Barkalow and Ilari Liusvaara</p></div>
635 </div>
636 <h2 id="_git">GIT</h2>
637 <div class="sectionbody">
638 <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
639 </div>
640 <div id="footer">
641 <div id="footer-text">
642 Last updated 2010-09-18 23:56:54 UTC
643 </div>
644 </div>
645 </body>
646 </html>