{
    "content": [
        {
            "type": "text",
            "text": "# GITREMOTE-HELPERS (man)\n\n## NAME\n\ngitremote-helpers - Helper programs to interact with remote repositories\n\n## SYNOPSIS\n\ngit remote-<transport> <repository> [<URL>]\n\n## DESCRIPTION\n\nRemote helper programs are normally not used directly by end users, but they are invoked by\nGit when it needs to interact with remote repositories Git does not support natively. A given\nhelper will implement a subset of the capabilities documented here. When Git needs to\ninteract with a repository using a remote helper, it spawns the helper as an independent\nprocess, sends commands to the helper’s standard input, and expects results from the helper’s\nstandard output. Because a remote helper runs as an independent process from Git, there is no\nneed to re-link Git to add a new helper, nor any need to link the helper with the\nimplementation of Git.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **INVOCATION**\n- **INPUT FORMAT** (4 subsections)\n- **COMMANDS**\n- **REF LIST ATTRIBUTES**\n- **REF LIST KEYWORDS**\n- **OPTIONS**\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GITREMOTE-HELPERS",
        "section": "",
        "mode": "man",
        "summary": "gitremote-helpers - Helper programs to interact with remote repositories",
        "synopsis": "git remote-<transport> <repository> [<URL>]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "git-remote",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-remote/1/json"
            },
            {
                "name": "git-remote-ext",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-remote-ext/1/json"
            },
            {
                "name": "git-remote-fd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-remote-fd/1/json"
            },
            {
                "name": "git-fast-import",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-fast-import/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "INVOCATION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "INPUT FORMAT",
                "lines": 10,
                "subsections": [
                    {
                        "name": "Capabilities",
                        "lines": 7
                    },
                    {
                        "name": "Capabilities for Pushing",
                        "lines": 36
                    },
                    {
                        "name": "Capabilities for Fetching",
                        "lines": 35
                    },
                    {
                        "name": "Miscellaneous capabilities",
                        "lines": 55
                    }
                ]
            },
            {
                "name": "COMMANDS",
                "lines": 145,
                "subsections": []
            },
            {
                "name": "REF LIST ATTRIBUTES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "REF LIST KEYWORDS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 79,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "gitremote-helpers - Helper programs to interact with remote repositories\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git remote-<transport> <repository> [<URL>]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Remote helper programs are normally not used directly by end users, but they are invoked by\nGit when it needs to interact with remote repositories Git does not support natively. A given\nhelper will implement a subset of the capabilities documented here. When Git needs to\ninteract with a repository using a remote helper, it spawns the helper as an independent\nprocess, sends commands to the helper’s standard input, and expects results from the helper’s\nstandard output. Because a remote helper runs as an independent process from Git, there is no\nneed to re-link Git to add a new helper, nor any need to link the helper with the\nimplementation of Git.\n\nEvery helper must support the \"capabilities\" command, which Git uses to determine what other\ncommands the helper will accept. Those other commands can be used to discover and update\nremote refs, transport objects between the object database and the remote repository, and\nupdate the local object store.\n\nGit comes with a \"curl\" family of remote helpers, that handle various transport protocols,\nsuch as git-remote-http, git-remote-https, git-remote-ftp and git-remote-ftps. They implement\nthe capabilities fetch, option, and push.\n",
                "subsections": []
            },
            "INVOCATION": {
                "content": "Remote helper programs are invoked with one or (optionally) two arguments. The first argument\nspecifies a remote repository as in Git; it is either the name of a configured remote or a\nURL. The second argument specifies a URL; it is usually of the form <transport>://<address>,\nbut any arbitrary string is possible. The GITDIR environment variable is set up for the\nremote helper and can be used to determine where to store additional data or from which\ndirectory to invoke auxiliary Git commands.\n\nWhen Git encounters a URL of the form <transport>://<address>, where <transport> is a\nprotocol that it cannot handle natively, it automatically invokes git remote-<transport> with\nthe full URL as the second argument. If such a URL is encountered directly on the command\nline, the first argument is the same as the second, and if it is encountered in a configured\nremote, the first argument is the name of that remote.\n\nA URL of the form <transport>::<address> explicitly instructs Git to invoke git\nremote-<transport> with <address> as the second argument. If such a URL is encountered\ndirectly on the command line, the first argument is <address>, and if it is encountered in a\nconfigured remote, the first argument is the name of that remote.\n\nAdditionally, when a configured remote has remote.<name>.vcs set to <transport>, Git\nexplicitly invokes git remote-<transport> with <name> as the first argument. If set, the\nsecond argument is remote.<name>.url; otherwise, the second argument is omitted.\n",
                "subsections": []
            },
            "INPUT FORMAT": {
                "content": "Git sends the remote helper a list of commands on standard input, one per line. The first\ncommand is always the capabilities command, in response to which the remote helper must print\na list of the capabilities it supports (see below) followed by a blank line. The response to\nthe capabilities command determines what commands Git uses in the remainder of the command\nstream.\n\nThe command stream is terminated by a blank line. In some cases (indicated in the\ndocumentation of the relevant commands), this blank line is followed by a payload in some\nother protocol (e.g., the pack protocol), while in others it indicates the end of input.\n",
                "subsections": [
                    {
                        "name": "Capabilities",
                        "content": "Each remote helper is expected to support only a subset of commands. The operations a helper\nsupports are declared to Git in the response to the capabilities command (see COMMANDS,\nbelow).\n\nIn the following, we list all defined capabilities and for each we list which commands a\nhelper with that capability must provide.\n"
                    },
                    {
                        "name": "Capabilities for Pushing",
                        "content": "connect\nCan attempt to connect to git receive-pack (for pushing), git upload-pack, etc for\ncommunication using git’s native packfile protocol. This requires a bidirectional,\nfull-duplex connection.\n\nSupported commands: connect.\n\nstateless-connect\nExperimental; for internal use only. Can attempt to connect to a remote server for\ncommunication using git’s wire-protocol version 2. See the documentation for the\nstateless-connect command for more information.\n\nSupported commands: stateless-connect.\n\npush\nCan discover remote refs and push local commits and the history leading up to them to\nnew or existing remote refs.\n\nSupported commands: list for-push, push.\n\nexport\nCan discover remote refs and push specified objects from a fast-import stream to\nremote refs.\n\nSupported commands: list for-push, export.\n\nIf a helper advertises connect, Git will use it if possible and fall back to another\ncapability if the helper requests so when connecting (see the connect command under\nCOMMANDS). When choosing between push and export, Git prefers push. Other frontends may\nhave some other order of preference.\n\nno-private-update\nWhen using the refspec capability, git normally updates the private ref on successful\npush. This update is disabled when the remote-helper declares the capability\nno-private-update.\n"
                    },
                    {
                        "name": "Capabilities for Fetching",
                        "content": "connect\nCan try to connect to git upload-pack (for fetching), git receive-pack, etc for\ncommunication using the Git’s native packfile protocol. This requires a\nbidirectional, full-duplex connection.\n\nSupported commands: connect.\n\nstateless-connect\nExperimental; for internal use only. Can attempt to connect to a remote server for\ncommunication using git’s wire-protocol version 2. See the documentation for the\nstateless-connect command for more information.\n\nSupported commands: stateless-connect.\n\nfetch\nCan discover remote refs and transfer objects reachable from them to the local object\nstore.\n\nSupported commands: list, fetch.\n\nimport\nCan discover remote refs and output objects reachable from them as a stream in\nfast-import format.\n\nSupported commands: list, import.\n\ncheck-connectivity\nCan guarantee that when a clone is requested, the received pack is self contained and\nis connected.\n\nIf a helper advertises connect, Git will use it if possible and fall back to another\ncapability if the helper requests so when connecting (see the connect command under\nCOMMANDS). When choosing between fetch and import, Git prefers fetch. Other frontends may\nhave some other order of preference.\n"
                    },
                    {
                        "name": "Miscellaneous capabilities",
                        "content": "option\nFor specifying settings like verbosity (how much output to write to stderr) and depth\n(how much history is wanted in the case of a shallow clone) that affect how other\ncommands are carried out.\n\nrefspec <refspec>\nFor remote helpers that implement import or export, this capability allows the refs\nto be constrained to a private namespace, instead of writing to refs/heads or\nrefs/remotes directly. It is recommended that all importers providing the import\ncapability use this. It’s mandatory for export.\n\nA helper advertising the capability refspec refs/heads/*:refs/svn/origin/branches/*\nis saying that, when it is asked to import refs/heads/topic, the stream it outputs\nwill update the refs/svn/origin/branches/topic ref.\n\nThis capability can be advertised multiple times. The first applicable refspec takes\nprecedence. The left-hand of refspecs advertised with this capability must cover all\nrefs reported by the list command. If no refspec capability is advertised, there is\nan implied refspec *:*.\n\nWhen writing remote-helpers for decentralized version control systems, it is advised\nto keep a local copy of the repository to interact with, and to let the private\nnamespace refs point to this local repository, while the refs/remotes namespace is\nused to track the remote repository.\n\nbidi-import\nThis modifies the import capability. The fast-import commands cat-blob and ls can be\nused by remote-helpers to retrieve information about blobs and trees that already\nexist in fast-import’s memory. This requires a channel from fast-import to the\nremote-helper. If it is advertised in addition to \"import\", Git establishes a pipe\nfrom fast-import to the remote-helper’s stdin. It follows that Git and fast-import\nare both connected to the remote-helper’s stdin. Because Git can send multiple\ncommands to the remote-helper it is required that helpers that use bidi-import buffer\nall import commands of a batch before sending data to fast-import. This is to prevent\nmixing commands and fast-import responses on the helper’s stdin.\n\nexport-marks <file>\nThis modifies the export capability, instructing Git to dump the internal marks table\nto <file> when complete. For details, read up on --export-marks=<file> in git-fast-\nexport(1).\n\nimport-marks <file>\nThis modifies the export capability, instructing Git to load the marks specified in\n<file> before processing any input. For details, read up on --import-marks=<file> in\ngit-fast-export(1).\n\nsigned-tags\nThis modifies the export capability, instructing Git to pass --signed-tags=verbatim\nto git-fast-export(1). In the absence of this capability, Git will use\n--signed-tags=warn-strip.\n\nobject-format\nThis indicates that the helper is able to interact with the remote side using an\nexplicit hash algorithm extension.\n"
                    }
                ]
            },
            "COMMANDS": {
                "content": "Commands are given by the caller on the helper’s standard input, one per line.\n\ncapabilities\nLists the capabilities of the helper, one per line, ending with a blank line. Each\ncapability may be preceded with *, which marks them mandatory for Git versions using the\nremote helper to understand. Any unknown mandatory capability is a fatal error.\n\nSupport for this command is mandatory.\n\nlist\nLists the refs, one per line, in the format \"<value> <name> [<attr> ...]\". The value may\nbe a hex sha1 hash, \"@<dest>\" for a symref, \":<keyword> <value>\" for a key-value pair, or\n\"?\" to indicate that the helper could not get the value of the ref. A space-separated\nlist of attributes follows the name; unrecognized attributes are ignored. The list ends\nwith a blank line.\n\nSee REF LIST ATTRIBUTES for a list of currently defined attributes. See REF LIST KEYWORDS\nfor a list of currently defined keywords.\n\nSupported if the helper has the \"fetch\" or \"import\" capability.\n\nlist for-push\nSimilar to list, except that it is used if and only if the caller wants to the resulting\nref list to prepare push commands. A helper supporting both push and fetch can use this\nto distinguish for which operation the output of list is going to be used, possibly\nreducing the amount of work that needs to be performed.\n\nSupported if the helper has the \"push\" or \"export\" capability.\n\noption <name> <value>\nSets the transport helper option <name> to <value>. Outputs a single line containing one\nof ok (option successfully set), unsupported (option not recognized) or error <msg>\n(option <name> is supported but <value> is not valid for it). Options should be set\nbefore other commands, and may influence the behavior of those commands.\n\nSee OPTIONS for a list of currently defined options.\n\nSupported if the helper has the \"option\" capability.\n\nfetch <sha1> <name>\nFetches the given object, writing the necessary objects to the database. Fetch commands\nare sent in a batch, one per line, terminated with a blank line. Outputs a single blank\nline when all fetch commands in the same batch are complete. Only objects which were\nreported in the output of list with a sha1 may be fetched this way.\n\nOptionally may output a lock <file> line indicating the full path of a file under\n$GITDIR/objects/pack which is keeping a pack until refs can be suitably updated. The\npath must end with .keep. This is a mechanism to name a <pack,idx,keep> tuple by giving\nonly the keep component. The kept pack will not be deleted by a concurrent repack, even\nthough its objects may not be referenced until the fetch completes. The .keep file will\nbe deleted at the conclusion of the fetch.\n\nIf option check-connectivity is requested, the helper must output connectivity-ok if the\nclone is self-contained and connected.\n\nSupported if the helper has the \"fetch\" capability.\n\npush +<src>:<dst>\nPushes the given local <src> commit or branch to the remote branch described by <dst>. A\nbatch sequence of one or more push commands is terminated with a blank line (if there is\nonly one reference to push, a single push command is followed by a blank line). For\nexample, the following would be two batches of push, the first asking the remote-helper\nto push the local ref master to the remote ref master and the local HEAD to the remote\nbranch, and the second asking to push ref foo to ref bar (forced update requested by the\n+).\n\npush refs/heads/master:refs/heads/master\npush HEAD:refs/heads/branch\n\\n\npush +refs/heads/foo:refs/heads/bar\n\\n\n\nZero or more protocol options may be entered after the last push command, before the\nbatch’s terminating blank line.\n\nWhen the push is complete, outputs one or more ok <dst> or error <dst> <why>?  lines to\nindicate success or failure of each pushed ref. The status report output is terminated by\na blank line. The option field <why> may be quoted in a C style string if it contains an\nLF.\n\nSupported if the helper has the \"push\" capability.\n\nimport <name>\nProduces a fast-import stream which imports the current value of the named ref. It may\nadditionally import other refs as needed to construct the history efficiently. The script\nwrites to a helper-specific private namespace. The value of the named ref should be\nwritten to a location in this namespace derived by applying the refspecs from the\n\"refspec\" capability to the name of the ref.\n\nEspecially useful for interoperability with a foreign versioning system.\n\nJust like push, a batch sequence of one or more import is terminated with a blank line.\nFor each batch of import, the remote helper should produce a fast-import stream\nterminated by a done command.\n\nNote that if the bidi-import capability is used the complete batch sequence has to be\nbuffered before starting to send data to fast-import to prevent mixing of commands and\nfast-import responses on the helper’s stdin.\n\nSupported if the helper has the \"import\" capability.\n\nexport\nInstructs the remote helper that any subsequent input is part of a fast-import stream\n(generated by git fast-export) containing objects which should be pushed to the remote.\n\nEspecially useful for interoperability with a foreign versioning system.\n\nThe export-marks and import-marks capabilities, if specified, affect this command in so\nfar as they are passed on to git fast-export, which then will load/store a table of marks\nfor local objects. This can be used to implement for incremental operations.\n\nSupported if the helper has the \"export\" capability.\n\nconnect <service>\nConnects to given service. Standard input and standard output of helper are connected to\nspecified service (git prefix is included in service name so e.g. fetching uses\ngit-upload-pack as service) on remote side. Valid replies to this command are empty line\n(connection established), fallback (no smart transport support, fall back to dumb\ntransports) and just exiting with error message printed (can’t connect, don’t bother\ntrying to fall back). After line feed terminating the positive (empty) response, the\noutput of service starts. After the connection ends, the remote helper exits.\n\nSupported if the helper has the \"connect\" capability.\n\nstateless-connect <service>\nExperimental; for internal use only. Connects to the given remote service for\ncommunication using git’s wire-protocol version 2. Valid replies to this command are\nempty line (connection established), fallback (no smart transport support, fall back to\ndumb transports) and just exiting with error message printed (can’t connect, don’t bother\ntrying to fall back). After line feed terminating the positive (empty) response, the\noutput of the service starts. Messages (both request and response) must consist of zero\nor more PKT-LINEs, terminating in a flush packet. Response messages will then have a\nresponse end packet after the flush packet to indicate the end of a response. The client\nmust not expect the server to store any state in between request-response pairs. After\nthe connection ends, the remote helper exits.\n\nSupported if the helper has the \"stateless-connect\" capability.\n\nIf a fatal error occurs, the program writes the error message to stderr and exits. The caller\nshould expect that a suitable error message has been printed if the child closes the\nconnection without completing a valid response for the current command.\n\nAdditional commands may be supported, as may be determined from capabilities reported by the\nhelper.\n",
                "subsections": []
            },
            "REF LIST ATTRIBUTES": {
                "content": "The list command produces a list of refs in which each ref may be followed by a list of\nattributes. The following ref list attributes are defined.\n\nunchanged\nThis ref is unchanged since the last import or fetch, although the helper cannot\nnecessarily determine what value that produced.\n",
                "subsections": []
            },
            "REF LIST KEYWORDS": {
                "content": "The list command may produce a list of key-value pairs. The following keys are defined.\n\nobject-format\nThe refs are using the given hash algorithm. This keyword is only used if the server and\nclient both support the object-format extension.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The following options are defined and (under suitable circumstances) set by Git if the remote\nhelper has the option capability.\n\noption verbosity <n>\nChanges the verbosity of messages displayed by the helper. A value of 0 for <n> means\nthat processes operate quietly, and the helper produces only error output. 1 is the\ndefault level of verbosity, and higher values of <n> correspond to the number of -v flags\npassed on the command line.\n\noption progress {true|false}\nEnables (or disables) progress messages displayed by the transport helper during a\ncommand.\n\noption depth <depth>\nDeepens the history of a shallow repository.\n\n'option deepen-since <timestamp>\nDeepens the history of a shallow repository based on time.\n\n'option deepen-not <ref>\nDeepens the history of a shallow repository excluding ref. Multiple options add up.\n\noption deepen-relative {'true|false}\nDeepens the history of a shallow repository relative to current boundary. Only valid when\nused with \"option depth\".\n\noption followtags {true|false}\nIf enabled the helper should automatically fetch annotated tag objects if the object the\ntag points at was transferred during the fetch command. If the tag is not fetched by the\nhelper a second fetch command will usually be sent to ask for the tag specifically. Some\nhelpers may be able to use this option to avoid a second network connection.\n\noption dry-run {true|false}: If true, pretend the operation completed successfully, but don’t\nactually change any repository data. For most helpers this only applies to the push, if\nsupported.\n\noption servpath <c-style-quoted-path>\nSets service path (--upload-pack, --receive-pack etc.) for next connect. Remote helper\nmay support this option, but must not rely on this option being set before connect\nrequest occurs.\n\noption check-connectivity {true|false}\nRequest the helper to check connectivity of a clone.\n\noption force {true|false}\nRequest the helper to perform a force update. Defaults to false.\n\noption cloning {true|false}\nNotify the helper this is a clone request (i.e. the current repository is guaranteed\nempty).\n\noption update-shallow {true|false}\nAllow to extend .git/shallow if the new refs require it.\n\noption pushcert {true|false}\nGPG sign pushes.\n\n'option push-option <string>\nTransmit <string> as a push option. As the push option must not contain LF or NUL\ncharacters, the string is not encoded.\n\noption from-promisor {true|false}\nIndicate that these objects are being fetched from a promisor.\n\noption no-dependents {true|false}\nIndicate that only the objects wanted need to be fetched, not their dependents.\n\noption atomic {true|false}\nWhen pushing, request the remote server to update refs in a single atomic transaction. If\nsuccessful, all refs will be updated, or none will. If the remote side does not support\nthis capability, the push will fail.\n\noption object-format {true|algorithm}\nIf true, indicate that the caller wants hash algorithm information to be passed back from\nthe remote. This mode is used when fetching refs.\n\nIf set to an algorithm, indicate that the caller wants to interact with the remote side\nusing that algorithm.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "git-remote(1)\n\ngit-remote-ext(1)\n\ngit-remote-fd(1)\n\ngit-fast-import(1)\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                         GITREMOTE-HELPERS(7)",
                "subsections": []
            }
        }
    }
}