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">
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">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
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
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
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
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-remote-helpers(
1) Manual Page
409 <div class=
"sectionbody">
410 <p>git-remote-helpers -
411 Helper programs to interact with remote repositories
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git remote-
<transport
></em> <repository
> [
<URL
>]
</div>
419 <div class=
"verseblock-attribution">
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
’s
430 standard input, and expects results from the helper
’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>
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><transport
>://
<address
></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><transport
>://
<address
></em>, where
459 <em><transport
></em> is a protocol that it cannot handle natively, it
460 automatically invokes
<em>git remote-
<transport
></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><transport
>::
<address
></em> explicitly instructs git to
466 invoke
<em>git remote-
<transport
></em> with
<em><address
></em> as the second
467 argument. If such a URL is encountered directly on the command line,
468 the first argument is
<em><address
></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.
<name
>.vcs
</em> set to
471 <em><transport
></em>, git explicitly invokes
<em>git remote-
<transport
></em> with
472 <em><name
></em> as the first argument. If set, the second argument is
473 <em>remote.
<name
>.url
</em>; otherwise, the second argument is omitted.
</p></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
’s standard input, one per line.
</p></div>
478 <div class=
"dlist"><dl>
480 <em>capabilities
</em>
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
496 Lists the refs, one per line, in the format
"<value> <name>
497 [<attr> …]". The value may be a hex sha1 hash,
"@<dest>" 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
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>
508 <em>option
</em> <name
> <value
>
512 Sets the transport helper option
<name
> to
<value
>. Outputs a
513 single line containing one of
<em>ok
</em> (option successfully set),
514 <em>unsupported
</em> (option not recognized) or
<em>error
<msg
></em>
515 (option
<name
> is supported but
<value
> is not valid
516 for it). Options should be set before other commands,
517 and may influence the behavior of those commands.
519 <div class=
"paragraph"><p>Supported if the helper has the
"option" capability.
</p></div>
522 <em>fetch
</em> <sha1
> <name
>
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.
533 <div class=
"paragraph"><p>Optionally may output a
<em>lock
<file
></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>
539 <em>push
</em> +
<src
>:
<dst
>
543 Pushes the given local
<src
> commit or branch to the
544 remote branch described by
<dst
>. A batch sequence of
545 one or more push commands is terminated with a blank line.
547 <div class=
"paragraph"><p>Zero or more protocol options may be entered after the last
<em>push
</em>
548 command, before the batch
’s terminating blank line.
</p></div>
549 <div class=
"paragraph"><p>When the push is complete, outputs one or more
<em>ok
<dst
></em> or
550 <em>error
<dst
> <why
>?
</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
<why
> 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>
557 <em>import
</em> <name
>
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
569 <div class=
"paragraph"><p>Especially useful for interoperability with a foreign versioning
571 <div class=
"paragraph"><p>Supported if the helper has the
"import" capability.
</p></div>
574 <em>connect
</em> <service
>
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
’t connect, don
’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.
589 <div class=
"paragraph"><p>Supported if the helper has the
"connect" capability.
</p></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>
599 <h2 id=
"_capabilities">CAPABILITIES
</h2>
600 <div class=
"sectionbody">
601 <div class=
"dlist"><dl>
619 This helper supports the corresponding command with the same name.
623 <em>refspec
</em> <em>spec
</em>
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/*:refs/svn/origin/branches/*" 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
"*:*"
639 <h2 id=
"_ref_list_attributes">REF LIST ATTRIBUTES
</h2>
640 <div class=
"sectionbody">
641 <div class=
"dlist"><dl>
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.
657 This ref is unchanged since the last import or fetch, although
658 the helper cannot necessarily determine what value that produced.
663 <h2 id=
"_options">OPTIONS
</h2>
664 <div class=
"sectionbody">
665 <div class=
"dlist"><dl>
667 <em>option verbosity
</em> <n
>
671 Changes the verbosity of messages displayed by the helper.
672 A value of
0 for
<n
> 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
<n
> correspond to the number of -v flags passed on the
680 <em>option progress
</em> {
<em>true
</em>|
<em>false
</em>}
684 Enables (or disables) progress messages displayed by the
685 transport helper during a command.
689 <em>option depth
</em> <depth
>
693 Deepens the history of a shallow repository.
697 <em>option followtags
</em> {
<em>true
</em>|
<em>false
</em>}
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.
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
’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>
716 <em>option servpath
<c-style-quoted-path
></em>
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.
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>
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>
737 <div id=
"footer-text">
738 Last updated
2011-
08-
02 00:
08:
47 UTC