GITREMOTE-HELPERS(7)
๐ gitremote-helpers(7) โ Git Manual ๐
okay bestie, buckle up โ this is the manual page for gitremote-helpers, aka the little helper programs that talk to remote repositories for Git. โจ
๐ธ NAME ๐ธ
gitremote-helpers โ helper programs to interact with remote repositories. ๐
โจ SYNOPSIS โจ
git remote-<transport> <repository> [<URL>]
๐ฆ DESCRIPTION ๐ฆ
Okay so remote helper programs are normally not used directly by end users, but Git invokes them when it needs to interact with remote repositories Git does not support natively. A given helper will implement a subset of the capabilities documented here.
When Git needs to interact with a repository using a remote helper, it spawns the helper as an independent process, sends commands to the helperโs standard input, and expects results from the helperโs standard output. Because a remote helper runs as an independent process from Git, there is no need to re-link Git to add a new helper, nor any need to link the helper with the implementation of Git. iconic architecture behavior, honestly ๐
Every helper must support the capabilities command, which Git uses to determine what other commands the helper will accept. Those other commands can be used to discover and update remote refs, transport objects between the object database and the remote repository, and update the local object store.
Git comes with a โcurlโ family of remote helpers, that handle various transport protocols, such as git-remote-http, git-remote-https, git-remote-ftp and git-remote-ftps. They implement the capabilities fetch, option, and push. slay ๐ซถ
๐ INVOCATION ๐
Remote helper programs are invoked with one or (optionally) two arguments. The first argument specifies a remote repository as in Git; it is either the name of a configured remote or a URL. The second argument specifies a URL; it is usually of the form <transport>://<address>, but any arbitrary string is possible. The GIT_DIR environment variable is set up for the remote helper and can be used to determine where to store additional data or from which directory to invoke auxiliary Git commands.
When Git encounters a URL of the form <transport>://<address>, where <transport> is a protocol that it cannot handle natively, it automatically invokes git remote-<transport> with the full URL as the second argument. If such a URL is encountered directly on the command line, the first argument is the same as the second, and if it is encountered in a configured remote, the first argument is the name of that remote.
A URL of the form <transport>::<address> explicitly instructs Git to invoke git remote-<transport> with <address> as the second argument. If such a URL is encountered directly on the command line, the first argument is <address>, and if it is encountered in a configured remote, the first argument is the name of that remote.
Additionally, when a configured remote has remote.<name>.vcs set to <transport>, Git explicitly invokes git remote-<transport> with <name> as the first argument. If set, the second argument is remote.<name>.url; otherwise, the second argument is omitted. no cap, thatโs the whole routing vibe โจ
๐ INPUT FORMAT ๐
Git sends the remote helper a list of commands on standard input, one per line. The first command is always the capabilities command, in response to which the remote helper must print a list of the capabilities it supports (see below) followed by a blank line. The response to the capabilities command determines what commands Git uses in the remainder of the command stream.
The command stream is terminated by a blank line. In some cases (indicated in the documentation of the relevant commands), this blank line is followed by a payload in some other protocol (e.g., the pack protocol), while in others it indicates the end of input. tiny detail, huge consequences ๐ญ
๐ง Capabilities ๐ง
Each remote helper is expected to support only a subset of commands. The operations a helper supports are declared to Git in the response to the capabilities command (see COMMANDS, below).
In the following, we list all defined capabilities and for each we list which commands a helper with that capability must provide.
๐ Capabilities for Pushing ๐
connectโ Can attempt to connect togit receive-pack(for pushing),git upload-pack, etc for communication using gitโs native packfile protocol. This requires a bidirectional, full-duplex connection.
Supported commands: connect.
stateless-connectโ Experimental; for internal use only. Can attempt to connect to a remote server for communication using gitโs wire-protocol version 2. See the documentation for thestateless-connectcommand for more information.
Supported commands: stateless-connect.
pushโ Can discover remote refs and push local commits and the history leading up to them to new or existing remote refs.
Supported commands: list for-push, push.
exportโ Can discover remote refs and push specified objects from a fast-import stream to remote refs.
Supported commands: list for-push, export.
If a helper advertises connect, Git will use it if possible and fall back to another capability if the helper requests so when connecting (see the connect command under COMMANDS). When choosing between push and export, Git prefers push. Other frontends may have some other order of preference. frontends stay having opinions, we love that for them ๐ฆ
no-private-updateโ When using therefspeccapability, git normally updates the private ref on successful push. This update is disabled when the remote-helper declares the capabilityno-private-update.
๐ธ Capabilities for Fetching ๐ธ
connectโ Can try to connect togit upload-pack(for fetching),git receive-pack, etc for communication using the Gitโs native packfile protocol. This requires a bidirectional, full-duplex connection.
Supported commands: connect.
stateless-connectโ Experimental; for internal use only. Can attempt to connect to a remote server for communication using gitโs wire-protocol version 2. See the documentation for thestateless-connectcommand for more information.
Supported commands: stateless-connect.
fetchโ Can discover remote refs and transfer objects reachable from them to the local object store.
Supported commands: list, fetch.
importโ Can discover remote refs and output objects reachable from them as a stream in fast-import format.
Supported commands: list, import.
check-connectivityโ Can guarantee that when a clone is requested, the received pack is self contained and is connected.getโ Can use thegetcommand to download a file from a given URI.
If a helper advertises connect, Git will use it if possible and fall back to another capability if the helper requests so when connecting (see the connect command under COMMANDS). When choosing between fetch and import, Git prefers fetch. Other frontends may have some other order of preference. same energy, different direction ๐
๐ Miscellaneous capabilities ๐
optionโ For specifying settings like verbosity (how much output to write to stderr) and depth (how much history is wanted in the case of a shallow clone) that affect how other commands are carried out.refspec <refspec>โ For remote helpers that implementimportorexport, this capability allows the refs to be constrained to a private namespace, instead of writing torefs/headsorrefs/remotesdirectly. It is recommended that all importers providing theimportcapability use this. Itโs mandatory forexport.
A helper advertising the capability refspec refs/heads/*:refs/svn/origin/branches/* is saying that, when it is asked to import refs/heads/topic, the stream it outputs will update the refs/svn/origin/branches/topic ref.
This capability can be advertised multiple times. The first applicable refspec takes precedence. The left-hand of refspecs advertised with this capability must cover all refs reported by the list command. If no refspec capability is advertised, there is an implied refspec *:*.
When writing remote-helpers for decentralized version control systems, it is advised to keep a local copy of the repository to interact with, and to let the private namespace refs point to this local repository, while the refs/remotes namespace is used to track the remote repository.
bidi-importโ This modifies theimportcapability. The fast-import commandscat-blobandlscan be used by remote-helpers to retrieve information about blobs and trees that already exist in fast-importโs memory. This requires a channel from fast-import to the remote-helper. If it is advertised in addition toimport, Git establishes a pipe from fast-import to the remote-helperโs stdin. It follows that Git and fast-import are both connected to the remote-helperโs stdin. Because Git can send multiple commands to the remote-helper it is required that helpers that usebidi-importbuffer all import commands of a batch before sending data to fast-import. This is to prevent mixing commands and fast-import responses on the helperโs stdin.export-marks <file>โ This modifies theexportcapability, instructing Git to dump the internal marks table to<file>when complete. For details, read up on--export-marks=<file>ingit-fast-export(1).import-marks <file>โ This modifies theexportcapability, instructing Git to load the marks specified in<file>before processing any input. For details, read up on--import-marks=<file>ingit-fast-export(1).signed-tagsโ This modifies theexportcapability, instructing Git to pass--signed-tags=verbatimtogit-fast-export(1). In the absence of this capability, Git will use--signed-tags=warn-strip.object-formatโ This indicates that the helper is able to interact with the remote side using an explicit hash algorithm extension.
๐ฎ COMMANDS ๐ฎ
Okay so the caller (that's Git, bestie) feeds commands to the helper on the helper's standard input, one per line. One. Per. Line. The way that's so clean?? ๐
capabilitiesโ lists what the helper can do, one per line, and the list ends with a blank line. Each capability can have a*in front of it, and that*means "mandatory for Git versions that use this remote helper to understand" โ so if Git sees a mandatory capability it doesn't recognize, that's a fatal error, no cap. ๐ซถ
Support for this command is mandatory. Like, you have to have it, it's the main character.
listโ lists the refs, again one per line, in the format"<value> <name> [<attr> ...]". And what even is<value>, you ask? It can be any of these:- a hex sha1 hash โจ
"@<dest>"for a symref":<keyword> <value>"for a key-value pair"?"โ which literally means the helper could not get the value of the ref ๐ญ
After the name comes a space-separated list of attributes, and any attributes that aren't recognized just get ignored (no drama). The whole list ends with a blank line.
Peep REF LIST ATTRIBUTES for the attributes currently defined and REF LIST KEYWORDS for the keywords currently defined, iykyk.
Supported if the helper has the "fetch" or "import" capability. ๐ฆ
list for-pushโ basically the same aslist, except it's used if and only if the caller wants the resulting ref list to prep push commands. So if a helper supports both push and fetch, this is how it tells which operation the output oflistis gonna be used for โ which can lowkey reduce the work it has to do. Efficient queen behavior. ๐
Supported if the helper has the "push" or "export" capability.
option <name> <value>โ sets the transport helper option<name>to<value>. Then it outputs a single line with exactly one of these, no cap:okโ the option was successfully set ๐ธunsupportedโ option not recognized ๐error <msg>โ the option<name>is supported, but<value>isn't valid for it ๐
Options should be set before other commands, and they may influence how those commands behave. So like, set them first, bestie.
See OPTIONS for the list of options that are currently defined.
Supported if the helper has the "option" capability.
fetch <sha1> <name>โ fetches the given object and writes the necessary objects into the database. Fetch commands come in a batch, one per line, terminated with a blank line. It outputs a single blank line once every fetch command in the same batch is complete. And here's the tea: only objects that were reported in the output oflistwith a sha1 may be fetched this way. Periodt.
It may optionally output a lock <file> line pointing at the full path of a file under $GIT_DIR/objects/pack that keeps a pack around until refs can be properly updated. The path must end with .keep. This is a mechanism for naming a <pack,idx,keep> tuple by giving only the keep component. The kept pack won't be deleted by a concurrent repack, even though its objects might not be referenced until the fetch finishes. The .keep file gets deleted when the fetch concludes. ๐ง
If option check-connectivity is requested, the helper must output connectivity-ok if the clone is self-contained and connected.
Supported if the helper has the "fetch" capability.
push +<src>:<dst>โ pushes the given local<src>commit or branch to the remote branch described by<dst>. A batch of one or more push commands is terminated with a blank line (so if there's only one reference to push, a single push command is followed by a blank line). For example โ get this โ the following would be two batches of push: the first asks the remote-helper to push the local refmasterto the remote refmasterand the localHEADto the remote branch, and the second asks to push reffooto refbar(that's a forced update, requested by the+):
push refs/heads/master:refs/heads/master
push HEAD:refs/heads/branch
\n
push +refs/heads/foo:refs/heads/bar
\n
Zero or more protocol options may be entered after the last push command, before the batch's terminating blank line. Slay.
When the push is complete, it outputs one or more ok <dst> or error <dst> <why>? lines to show success or failure for each pushed ref. The status report output is terminated by a blank line. And the option field <why> may be quoted in a C style string if it contains an LF. ๐
Supported if the helper has the "push" capability.
import <name>โ produces a fast-import stream that imports the current value of the named ref. It may additionally import other refs as needed to construct the history efficiently. The script writes to a helper-specific private namespace, and the value of the named ref should be written to a location in that namespace derived by applying the refspecs from the"refspec"capability to the name of the ref.
Especially useful for interoperability with a foreign versioning system. ๐ฆ
Just like push, a batch of one or more import is terminated with a blank line. For each batch of import, the remote helper should produce a fast-import stream terminated by a done command.
Heads up bestie: if the bidi-import capability is used, the complete batch sequence has to be buffered before starting to send data to fast-import โ otherwise you get commands and fast-import responses mixing on the helper's stdin and that's a whole mess. ๐ญ
Supported if the helper has the "import" capability.
exportโ tells the remote helper that any subsequent input is part of a fast-import stream (generated bygit fast-export) containing objects that should be pushed to the remote. ๐ค
Especially useful for interoperability with a foreign versioning system. (yes, same energy, iconic)
The export-marks and import-marks capabilities, if specified, affect this command in that they're passed on to git fast-export, which will then load/store a table of marks for local objects. This can be used to implement incremental operations. โจ
Supported if the helper has the "export" capability.
connect <service>โ connects to the given service. The helper's standard input and standard output get connected to the specified service on the remote side (thegitprefix is included in the service name, so for example fetching usesgit-upload-packas the service). Valid replies to this command:- an empty line โ connection established ๐
fallbackโ no smart transport support, so fall back to dumb transports- just exiting with an error message printed โ can't connect, don't even bother trying to fall back ๐
After the line feed terminating the positive (empty) response, the output of the service starts. And after the connection ends, the remote helper exits. Bye bestie ๐
Supported if the helper has the "connect" capability.
stateless-connect <service>โ Experimental; for internal use only. ๐ Connects to the given remote service for communication using Git's wire-protocol version 2. Valid replies are the same trio: an empty line (connection established),fallback(no smart transport support, fall back to dumb transports), and just exiting with an error message printed (can't connect, don't bother trying to fall back). After the line feed terminating the positive (empty) response, the output of the service starts.
Messages (both request and response) must consist of zero or more PKT-LINEs, terminating in a flush packet. Response messages will then have a response end packet after the flush packet to indicate the end of a response. The client must not expect the server to store any state in between request-response pairs. After the connection ends, the remote helper exits.
Supported if the helper has the "stateless-connect" capability.
get <uri> <path>โ downloads the file from the given<uri>to the given<path>. And here's a cute little detail: if<path>.tempexists, Git assumes that.tempfile is a partial download from a previous attempt and will resume the download from that position. Resumable downloads, we love to see it. ๐ซถ
If a fatal error occurs, the program writes the error message to stderr and exits. The caller should expect that a suitable error message has been printed if the child closes the connection without completing a valid response for the current command. So like, no silent ghosting. ๐ค
Additional commands may also be supported โ that's determined from the capabilities reported by the helper. โจ
๐ REF LIST ATTRIBUTES ๐
So the list command produces a list of refs, and each ref may be followed by a list of attributes. These are the ref list attributes that are currently defined:
unchangedโ this ref is unchanged since the last import or fetch, although the helper can't necessarily determine what value that produced. ๐ (like, it's the same, but don't ask it to prove it)
๐ REF LIST KEYWORDS ๐
And the list command may also produce a list of key-value pairs. These keys are the ones currently defined:
object-formatโ the refs are using the given hash algorithm. This keyword is only used if the server and the client both support theobject-formatextension. ๐ค
โจ OPTIONS โจ
okay so these are the options Git itself defines โ and it only sets them if your remote helper has the option capability. no capability, no options, no vibes. ๐ซถ
option verbosity <n>โ changes how chatty the helper's messages are.<n>of0means everything runs quietly and the helper only spits out error output.1is the default level of verbosity, and higher values of<n>line up with the number of-vflags passed on the command line. so like,-v -v -v=<n>of 3, iykyk ๐option progress {true|false}โ turns progress messages on (or off) while the transport helper is doing a command. yes bestie we love a little loading bar moment ๐ธoption depth <depth>โ deepens the history of a shallow repository.option deepen-since <timestamp>โ deepens the history of a shallow repository, but based on time. โฐoption deepen-not <ref>โ deepens the history of a shallow repository while excludingref. and no cap, multiple of these options add up โ they stack. ๐งoption deepen-relative {true|false}โ deepens the history of a shallow repository relative to the current boundary. only valid when used withoption depth, so don't be out here using it solo ๐option followtags {true|false}โ if enabled, the helper should automatically fetch annotated tag objects when the object the tag points at got transferred during thefetchcommand. if the helper doesn't fetch the tag, a secondfetchcommand will usually be sent to ask for that tag specifically. some helpers can use this option to dodge a whole second network connection โ icon behaviour, honestly ๐option dry-run {true|false}โ if true, pretend the operation completed successfully, but don't actually change any repository data. for most helpers this only applies to thepush, if supported. fake it till you make it, but make it fake ๐option servpath <c-style-quoted-path>โ sets the service path (--upload-pack,--receive-pack, etc.) for the nextconnect. a remote helper may support this option, but it must not rely on this option being set before the connect request occurs. read that again: must not rely ๐ซถoption check-connectivity {true|false}โ asks the helper to check connectivity of a clone.option force {true|false}โ asks the helper to perform a force update. defaults tofalse. โจoption cloning {true|false}โ lets the helper know this is a clone request, i.e. the current repository is guaranteed empty. fresh start energy ๐option update-shallow {true|false}โ allows extending.git/shallowif the new refs require it.option pushcert {true|false}โ GPG sign pushes. ๐ฅoption push-option <string>โ transmits<string>as a push option. since the push option must not contain LF or NUL characters, the string is not encoded. so like, don't sneak a newline in there, bestie ๐ญoption from-promisor {true|false}โ indicates that these objects are being fetched from a promisor.option no-dependents {true|false}โ indicates that only the objects wanted need to be fetched, not their dependents.option atomic {true|false}โ when pushing, requests that the remote server update refs in a single atomic transaction. if it works, all refs get updated, or none do. if the remote side doesn't support this capability, the push will fail. all-or-nothing, main character energy โญoption object-format trueโ indicates that the caller wants hash algorithm information passed back from the remote. this mode is used when fetching refs. (notice it's justtruehere โ that's the only value listed, so don't improvise ๐)
๐ธ SEE ALSO ๐ธ
๐ GIT ๐
part of the git(1) suite. one big happy family ๐ซถ
and that's a wrap on the whole page, bestie!! ๐ this was written up as part of Git 2.56.0, dated 2026-09-27, and it lives at GITREMOTE-HELPERS(7) โ like, that's literally the whole footer, go off ๐ โจ
๐ฆ where this page comes from
- arch rolling: git 2.56.0-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms