{
    "mode": "info",
    "parameter": "gitremote-helpers",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/gitremote-helpers/json",
    "generated": "2026-07-12T12:15:13Z",
    "synopsis": "git remote-<transport> <repository> [<URL>]",
    "sections": {
        "NAME": {
            "content": "gitremote-helpers - Helper programs to interact with remote\nrepositories\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git remote-<transport> <repository> [<URL>]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Remote helper programs are normally not used directly by end users, but\nthey are invoked by Git when it needs to interact with remote\nrepositories Git does not support natively. A given helper will\nimplement a subset of the capabilities documented here. When Git needs\nto interact with a repository using a remote helper, it spawns the\nhelper as an independent process, sends commands to the helper's\nstandard input, and expects results from the helper's standard output.\nBecause a remote helper runs as an independent process from Git, there\nis no need to re-link Git to add a new helper, nor any need to link the\nhelper with the implementation of Git.\n\nEvery helper must support the \"capabilities\" command, which Git uses to\ndetermine what other commands the helper will accept. Those other\ncommands can be used to discover and update remote refs, transport\nobjects 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\ntransport protocols, such as git-remote-http, git-remote-https,\ngit-remote-ftp and git-remote-ftps. They implement the capabilities\nfetch, option, and push.\n",
            "subsections": []
        },
        "INVOCATION": {
            "content": "Remote helper programs are invoked with one or (optionally) two\narguments. The first argument specifies a remote repository as in Git;\nit is either the name of a configured remote or a URL. The second\nargument specifies a URL; it is usually of the form\n<transport>://<address>, but any arbitrary string is possible. The\nGITDIR environment variable is set up for the remote helper and can be\nused 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\n<transport> is a protocol that it cannot handle natively, it\nautomatically invokes git remote-<transport> with the full URL as the\nsecond 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\nencountered in a configured remote, the first argument is the name of\nthat remote.\n\nA URL of the form <transport>::<address> explicitly instructs Git to\ninvoke git remote-<transport> with <address> as the second argument. If\nsuch a URL is encountered directly on the command line, the first\nargument is <address>, and if it is encountered in a configured remote,\nthe first argument is the name of that remote.\n\nAdditionally, when a configured remote has remote.<name>.vcs set to\n<transport>, Git explicitly invokes git remote-<transport> with <name>\nas the first argument. If set, the second argument is\nremote.<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\nper line. The first command is always the capabilities command, in\nresponse to which the remote helper must print a list of the\ncapabilities it supports (see below) followed by a blank line. The\nresponse to the capabilities command determines what commands Git uses\nin the remainder of the command stream.\n\nThe command stream is terminated by a blank line. In some cases\n(indicated in the documentation of the relevant commands), this blank\nline is followed by a payload in some other protocol (e.g., the pack\nprotocol), while in others it indicates the end of input.\n\nCapabilities\nEach remote helper is expected to support only a subset of commands.\nThe operations a helper supports are declared to Git in the response to\nthe capabilities command (see COMMANDS, below).\n\nIn the following, we list all defined capabilities and for each we list\nwhich commands a helper with that capability must provide.\n\nCapabilities for Pushing\nconnect\nCan attempt to connect to git receive-pack (for pushing), git\nupload-pack, etc for communication using git's native packfile\nprotocol. This requires a bidirectional, full-duplex\nconnection.\n\nSupported commands: connect.\n\nstateless-connect\nExperimental; for internal use only. Can attempt to connect to\na remote server for communication using git's wire-protocol\nversion 2. See the documentation for the stateless-connect\ncommand for more information.\n\nSupported commands: stateless-connect.\n\npush\nCan discover remote refs and push local commits and the history\nleading up to them to new or existing remote refs.\n\nSupported commands: list for-push, push.\n\nexport\nCan discover remote refs and push specified objects from a\nfast-import stream to remote refs.\n\nSupported commands: list for-push, export.\n\nIf a helper advertises connect, Git will use it if possible and\nfall back to another capability if the helper requests so when\nconnecting (see the connect command under COMMANDS). When choosing\nbetween push and export, Git prefers push. Other frontends may have\nsome other order of preference.\n\nno-private-update\nWhen using the refspec capability, git normally updates the\nprivate ref on successful push. This update is disabled when\nthe remote-helper declares the capability no-private-update.\n\nCapabilities for Fetching\nconnect\nCan try to connect to git upload-pack (for fetching), git\nreceive-pack, etc for communication using the Git's native\npackfile protocol. This requires a bidirectional, full-duplex\nconnection.\n\nSupported commands: connect.\n\nstateless-connect\nExperimental; for internal use only. Can attempt to connect to\na remote server for communication using git's wire-protocol\nversion 2. See the documentation for the stateless-connect\ncommand for more information.\n\nSupported commands: stateless-connect.\n\nfetch\nCan discover remote refs and transfer objects reachable from\nthem to the local object store.\n\nSupported commands: list, fetch.\n\nimport\nCan discover remote refs and output objects reachable from them\nas a stream in fast-import format.\n\nSupported commands: list, import.\n\ncheck-connectivity\nCan guarantee that when a clone is requested, the received pack\nis self contained and is connected.\n\nIf a helper advertises connect, Git will use it if possible and\nfall back to another capability if the helper requests so when\nconnecting (see the connect command under COMMANDS). When choosing\nbetween fetch and import, Git prefers fetch. Other frontends may\nhave some other order of preference.\n\nMiscellaneous capabilities\noption\nFor specifying settings like verbosity (how much output to\nwrite to stderr) and depth (how much history is wanted in the\ncase of a shallow clone) that affect how other commands are\ncarried out.\n\nrefspec <refspec>\nFor remote helpers that implement import or export, this\ncapability allows the refs to be constrained to a private\nnamespace, instead of writing to refs/heads or refs/remotes\ndirectly. It is recommended that all importers providing the\nimport capability use this. It's mandatory for export.\n\nA helper advertising the capability refspec\nrefs/heads/*:refs/svn/origin/branches/* is saying that, when it\nis asked to import refs/heads/topic, the stream it outputs will\nupdate the refs/svn/origin/branches/topic ref.\n\nThis capability can be advertised multiple times. The first\napplicable refspec takes precedence. The left-hand of refspecs\nadvertised with this capability must cover all refs reported by\nthe list command. If no refspec capability is advertised, there\nis an implied refspec *:*.\n\nWhen writing remote-helpers for decentralized version control\nsystems, it is advised to keep a local copy of the repository\nto interact with, and to let the private namespace refs point\nto 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\ncat-blob and ls can be used by remote-helpers to retrieve\ninformation about blobs and trees that already exist in\nfast-import's memory. This requires a channel from fast-import\nto the remote-helper. If it is advertised in addition to\n\"import\", Git establishes a pipe from fast-import to the\nremote-helper's stdin. It follows that Git and fast-import are\nboth connected to the remote-helper's stdin. Because Git can\nsend multiple commands to the remote-helper it is required that\nhelpers that use bidi-import buffer all import commands of a\nbatch before sending data to fast-import. This is to prevent\nmixing commands and fast-import responses on the helper's\nstdin.\n\nexport-marks <file>\nThis modifies the export capability, instructing Git to dump\nthe internal marks table to <file> when complete. For details,\nread up on --export-marks=<file> in git-fast-export(1).\n\nimport-marks <file>\nThis modifies the export capability, instructing Git to load\nthe marks specified in <file> before processing any input. For\ndetails, read up on --import-marks=<file> in git-fast-\nexport(1).\n\nsigned-tags\nThis modifies the export capability, instructing Git to pass\n--signed-tags=verbatim to git-fast-export(1). In the absence of\nthis capability, Git will use --signed-tags=warn-strip.\n\nobject-format\nThis indicates that the helper is able to interact with the\nremote side using an explicit hash algorithm extension.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "Commands are given by the caller on the helper's standard input, one\nper line.\n\ncapabilities\nLists the capabilities of the helper, one per line, ending with a\nblank line. Each capability may be preceded with *, which marks\nthem mandatory for Git versions using the remote helper to\nunderstand. 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>\n...]\". The value may be a hex sha1 hash, \"@<dest>\" for a symref,\n\":<keyword> <value>\" for a key-value pair, or \"?\" to indicate that\nthe helper could not get the value of the ref. A space-separated\nlist of attributes follows the name; unrecognized attributes are\nignored. The list ends with a blank line.\n\nSee REF LIST ATTRIBUTES for a list of currently defined attributes.\nSee REF LIST KEYWORDS for 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\nwants to the resulting ref list to prepare push commands. A helper\nsupporting both push and fetch can use this to distinguish for\nwhich 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\nsingle line containing one of ok (option successfully set),\nunsupported (option not recognized) or error <msg> (option <name>\nis supported but <value> is not valid for it). Options should be\nset before other commands, and may influence the behavior of those\ncommands.\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\ndatabase. Fetch commands are sent in a batch, one per line,\nterminated with a blank line. Outputs a single blank line when all\nfetch commands in the same batch are complete. Only objects which\nwere reported in the output of list with a sha1 may be fetched this\nway.\n\nOptionally may output a lock <file> line indicating the full path\nof a file under $GITDIR/objects/pack which is keeping a pack until\nrefs can be suitably updated. The path must end with .keep. This is\na mechanism to name a <pack,idx,keep> tuple by giving only the keep\ncomponent. The kept pack will not be deleted by a concurrent\nrepack, even though its objects may not be referenced until the\nfetch completes. The .keep file will be deleted at the conclusion\nof the fetch.\n\nIf option check-connectivity is requested, the helper must output\nconnectivity-ok if the clone 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\ndescribed by <dst>. A batch sequence of one or more push commands\nis terminated with a blank line (if there is only one reference to\npush, a single push command is followed by a blank line). For\nexample, the following would be two batches of push, the first\nasking the remote-helper to push the local ref master to the remote\nref master and the local HEAD to the remote branch, and the second\nasking 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\ncommand, before the batch's terminating blank line.\n\nWhen the push is complete, outputs one or more ok <dst> or error\n<dst> <why>?  lines to indicate success or failure of each pushed\nref. The status report output is terminated by a blank line. The\noption field <why> may be quoted in a C style string if it contains\nan LF.\n\nSupported if the helper has the \"push\" capability.\n\nimport <name>\nProduces a fast-import stream which imports the current value of\nthe named ref. It may additionally import other refs as needed to\nconstruct the history efficiently. The script writes to a\nhelper-specific private namespace. The value of the named ref\nshould be written to a location in this namespace derived by\napplying the refspecs from the \"refspec\" capability to the name of\nthe ref.\n\nEspecially useful for interoperability with a foreign versioning\nsystem.\n\nJust like push, a batch sequence of one or more import is\nterminated with a blank line. For each batch of import, the remote\nhelper should produce a fast-import stream terminated by a done\ncommand.\n\nNote that if the bidi-import capability is used the complete batch\nsequence has to be buffered before starting to send data to\nfast-import to prevent mixing of commands and fast-import responses\non 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\nfast-import stream (generated by git fast-export) containing\nobjects which should be pushed to the remote.\n\nEspecially useful for interoperability with a foreign versioning\nsystem.\n\nThe export-marks and import-marks capabilities, if specified,\naffect this command in so far as they are passed on to git\nfast-export, which then will load/store a table of marks for local\nobjects. 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\nhelper are connected to specified service (git prefix is included\nin service name so e.g. fetching uses git-upload-pack as service)\non remote side. Valid replies to this command are empty line\n(connection established), fallback (no smart transport support,\nfall back to dumb transports) and just exiting with error message\nprinted (can't connect, don't bother trying to fall back). After\nline feed terminating the positive (empty) response, the output of\nservice 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\nservice for communication using git's wire-protocol version 2.\nValid replies to this command are empty line (connection\nestablished), fallback (no smart transport support, fall back to\ndumb transports) and just exiting with error message printed (can't\nconnect, don't bother trying to fall back). After line feed\nterminating the positive (empty) response, the output of the\nservice starts. Messages (both request and response) must consist\nof zero or more PKT-LINEs, terminating in a flush packet. Response\nmessages will then have a response end packet after the flush\npacket to indicate the end of a response. The client must not\nexpect the server to store any state in between request-response\npairs. After the 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\nand exits. The caller should expect that a suitable error message has\nbeen printed if the child closes the connection without completing a\nvalid response for the current command.\n\nAdditional commands may be supported, as may be determined from\ncapabilities reported by the helper.\n",
            "subsections": []
        },
        "REF LIST ATTRIBUTES": {
            "content": "The list command produces a list of refs in which each ref may be\nfollowed by a list of attributes. The following ref list attributes are\ndefined.\n\nunchanged\nThis ref is unchanged since the last import or fetch, although the\nhelper cannot necessarily determine what value that produced.\n",
            "subsections": []
        },
        "REF LIST KEYWORDS": {
            "content": "The list command may produce a list of key-value pairs. The following\nkeys are defined.\n\nobject-format\nThe refs are using the given hash algorithm. This keyword is only\nused if the server and client both support the object-format\nextension.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are defined and (under suitable circumstances)\nset by Git if the remote helper has the option capability.\n\noption verbosity <n>\nChanges the verbosity of messages displayed by the helper. A value\nof 0 for <n> means that processes operate quietly, and the helper\nproduces only error output. 1 is the default level of verbosity,\nand 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\nhelper during a command.\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\noptions add up.\n\noption deepen-relative {'true|false}\nDeepens the history of a shallow repository relative to current\nboundary. Only valid when used with \"option depth\".\n\noption followtags {true|false}\nIf enabled the helper should automatically fetch annotated tag\nobjects if the object the tag points at was transferred during the\nfetch command. If the tag is not fetched by the helper a second\nfetch command will usually be sent to ask for the tag specifically.\nSome helpers may be able to use this option to avoid a second\nnetwork connection.\n\noption dry-run {true|false}: If true, pretend the operation completed\nsuccessfully, but don't actually change any repository data. For most\nhelpers this only applies to the push, if supported.\n\noption servpath <c-style-quoted-path>\nSets service path (--upload-pack, --receive-pack etc.) for next\nconnect. Remote helper may support this option, but must not rely\non this option being set before connect request 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\nrepository is guaranteed empty).\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\ncontain LF or NUL characters, 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\ndependents.\n\noption atomic {true|false}\nWhen pushing, request the remote server to update refs in a single\natomic transaction. If successful, all refs will be updated, or\nnone will. If the remote side does not support this capability, the\npush will fail.\n\noption object-format {true|algorithm}\nIf true, indicate that the caller wants hash algorithm information\nto be passed back from the remote. This mode is used when fetching\nrefs.\n\nIf set to an algorithm, indicate that the caller wants to interact\nwith the remote side using 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\nGit 2.34.1                        02/26/2026              GITREMOTE-HELPERS(7)",
            "subsections": []
        }
    },
    "summary": "gitremote-helpers - Helper programs to interact with remote repositories",
    "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"
        }
    ]
}