LinuxCommandLibrary

git-remote-fd

Communicate with Git remote over file descriptors

SYNOPSIS

git remote-fd <name> [--upload-pack=<exec>] [--receive-pack=<exec>] <directory>

PARAMETERS

--upload-pack=<exec>
    Command to run for fetch operations (default: git upload-pack in directory)

--receive-pack=<exec>
    Command to run for push operations (default: git receive-pack in directory)

DESCRIPTION

git-remote-fd is a low-level Git plumbing command that implements a remote helper for accessing repositories via file descriptors. It proxies the Git wire protocol over stdin and stdout, assuming these streams are connected to a running git-upload-pack or git-receive-pack process.

This enables Git operations like fetch and push in environments without network sockets, such as pipes between processes, containers, or scripted workflows. It is automatically invoked when using URLs of the form fd::<directory>, e.g., git fetch origin fd::/path/to/repo.

The command spawns the specified pack executables pointed at the given repository directory, handling capability negotiation, packfile transfer, and refs advertisement. It supports stateless RPC (--stateless-rpc) modes common in CI/CD pipelines or serverless Git hosting.

Primarily internal, it integrates with Git's transport layer for seamless operation without user intervention.

CAVEATS

Plumbing command; requires stdin/stdout piped to compatible pack process.
Not for direct interactive use. No built-in authentication or HTTP/SSH support.

URL SCHEME

Supports fd::<directory> remote URLs; Git auto-invokes helper, e.g., git remote add origin fd::/tmp/repo.

HISTORY

Added in Git 1.7.10 (May 2012) to enable pipe-based transports and stateless RPC support, enhancing Git's flexibility in scripted and embedded scenarios.

SEE ALSO

git-remote-helpers(7), git-upload-pack(1), git-receive-pack(1), git-fetch(1)

Copied to clipboard