LinuxCommandLibrary

git-http-fetch

Download objects over HTTP or HTTPS

SYNOPSIS

git-http-fetch [-a|--all] [-c] [-t|--tags] [-u] [--mirror] <url> [<refspec>...]

PARAMETERS

-a | --all
    Fetch all references from the remote repository.

-c
    Perform a checkout operation after fetching. (Less common in modern usage, typically handled by higher-level commands.)

-t | --tags
    Fetch all tags from the remote repository.

-u
    Update existing references. (Similar to -c in context of older usage.)

--mirror
    Mirror the remote repository, fetching all branches and tags, and pruning obsolete local refs.

<url>
    The URL of the remote Git repository to fetch from.

<refspec>...
    Optional list of refspecs to fetch. A refspec specifies which refs on the remote are mapped to which local refs.

DESCRIPTION

git-http-fetch is a
plumbing command
in Git, primarily used internally by higher-level commands like
git fetch
or
git pull
when interacting with Git repositories over HTTP or HTTPS. It implements the "dumb" HTTP protocol, which involves fetching individual Git objects (commits, trees, blobs) and reference advertisements directly from a web server. Unlike the more efficient "smart" HTTP protocol (handled by
git-remote-http
), the dumb protocol requires more HTTP requests and can be less performant for large repositories or frequent updates. It is typically not invoked directly by users, but rather orchestrates the low-level data transfer for Git's HTTP client.

CAVEATS

This command implements the "dumb" HTTP protocol, which is less efficient than the "smart" HTTP protocol used by
git-remote-http
. It is primarily an internal plumbing command and is generally not intended for direct user invocation. Its functionality has largely been superseded or integrated into
git-remote-http
for modern Git versions, which handle both smart and dumb HTTP transport. Authentication for HTTP/S remotes might require external credential helpers.

HISTORY

git-http-fetch
was one of the earliest components enabling Git to interact with repositories over HTTP/HTTPS. It was crucial for allowing Git users to clone and pull from servers without direct SSH access or the specialized Git protocol. Over time, the more efficient "smart" HTTP protocol was developed, and its implementation,
git-remote-http
, largely absorbed and improved upon the capabilities of
git-http-fetch
, relegating the latter to a more specialized or fallback role for older, "dumb" HTTP servers or as a low-level internal component.

SEE ALSO

git-fetch(1), git-pull(1), git-remote-http(1), git(1)

Copied to clipboard