git-parse-remote
Parse remote repository access information
SYNOPSIS
git parse-remote [options] <url>
PARAMETERS
--git-protocol=<protocol>
Override the automatically detected Git protocol (e.g., git, http, ssh)
DESCRIPTION
git parse-remote is a low-level plumbing command in Git that takes a remote repository URL as input and breaks it down into its constituent parts, outputting them in a structured, machine-readable format. The output is a colon-separated string containing the transport protocol, hostname, path, username (if present), and port (if non-standard).
For example, inputting git://example.com/repo.git might output git:example.com:/repo.git::. This command supports common Git protocols like git://, http://, https://, ssh://, and scp-like syntax (e.g., git@example.com:repo.git).
It is primarily used internally by higher-level Git commands such as git ls-remote, git clone, and git remote to reliably parse and interpret remote specifications without relying on shell parsing or heuristics. End users rarely invoke it directly, as its output format is not intended for human consumption and may evolve between Git versions.
CAVEATS
Plumbing command for scripts only; output format is unstable and not for direct human use. Requires a valid URL argument.
OUTPUT FORMAT
Colon-separated: transport:host:path:user:port. Empty fields use consecutive colons.
EXAMPLE
git parse-remote git://host/repo.git
Outputs: git:host:/repo.git::
HISTORY
Introduced in Git 1.7.5 as part of plumbing tools to standardize remote URL parsing; evolved with support for new protocols in subsequent releases.
SEE ALSO
git-ls-remote(1), git-remote(1), git-clone(1)


