git-remote-ext
Use external programs for Git remotes
SYNOPSIS
git remote-ext [--stdin] [--stdout] [--stderr] helper url
PARAMETERS
--stdin
Read transport requests from stdin (testing mode, skips spawning helper)
--stdout
Write responses to stdout (testing mode)
--stderr
Send diagnostics to stderr (testing mode)
helper
Executable name or path (searched in $PATH or absolute)
url
Full remote URL passed to helper (e.g., exec:///path)
DESCRIPTION
git-remote-ext is a low-level Git plumbing command used to execute arbitrary external programs as custom remote transport helpers. It enables Git to interact with remote repositories via non-native protocols by spawning an executable helper that communicates over stdin/stdout/stderr.
Git automatically invokes git-remote-ext when a remote URL uses the exec:// scheme. For example:
git remote add origin exec:///usr/local/bin/my-helper
This results in Git running git-remote-ext my-helper exec:///usr/local/bin/my-helper during operations like fetch or push.
The helper (basename or path) must implement Git's remote helper protocol (see git-remote-helpers(7)). It handles commands such as capabilities, list for refs, import/export for objects, and connect. Helpers can support push, fetch, or both, and declare capabilities like connect or push.
Use cases include integrating with cloud APIs (e.g., git-remote-bzr, git-remote-hg), proprietary systems, or shell wrappers for APIs. For helpers in $PATH, use exec::helpername; for full paths, exec:///full/path (three slashes). Options like --stdin aid testing without full Git integration.
CAVEATS
Plumbing command; not for direct use. Helper must strictly follow protocol or Git operations fail. Absolute paths use exec:/// (three slashes); relative/searchable use exec::. Security risk if helper untrusted.
CONFIGURATION EXAMPLE
git remote add foo exec::myhelper arg1
or
git remote add bar exec:///opt/bin/custom-helper
Then git fetch foo invokes helper via git-remote-ext.
HELPER REQUIREMENTS
Must print capabilities first (e.g., fetch push), handle list for refs. Full spec in git-remote-helpers(7).
HISTORY
Part of Git's remote helpers framework since v1.6.6 (2008); exec:// support added v1.7.7 (2010) for arbitrary executables beyond prefixed git-remote-*. Evolved for better custom transport integration.
SEE ALSO
git-remote(1), git-remote-helpers(7), git-fetch(1), git-push(1)


