Progress:
TIER 3 · MODULE 50· Expert

git http-fetch

Object-by-object download over plain HTTP.

🎯 What & why

git http-fetch walks a remote repository over plain HTTP, downloading objects one by one starting from a given commit. It exists for the ancient dumb-HTTP transport, where the server is just a static file host with no Git CGI.

🧠 Mental model

Smart HTTP negotiates a single packfile for the whole transfer; dumb HTTP cannot. http-fetch instead does what an old web spider would: GET an object, parse it, GET its referenced objects, repeat. Many round trips, no negotiation.

🛠️ Synopsis

git http-fetch [-c] [-t] [-a] [-v] [-w <filename>]
               [--recover] [--stdin] <commit> <url>

Pulls the commit's reachable history from <url> into the current repo's object store. With `--stdin`, reads `<sha> <ref>` lines instead.

🎚️ Switches & options

FlagWhat it does
<commit> <url>Starting commit SHA and the remote base URL (no trailing info/refs).
-cAlso fetch commit history (default for normal use; explicit here).
-tAlso fetch tags reachable from the walked commits.
-aEquivalent to -c -t; fetch commits and tags.
-vVerbose -- print each object SHA as it lands on disk.
-w <filename>Write the resolved tip SHA into <filename> after success.
--recoverResume an interrupted fetch by filling missing objects.

💡 Use cases

🧪 Examples

Fetch one commit's history
git http-fetch -a abcd1234 http://127.0.0.1/repo.git/
Verbose with tip recorded
git http-fetch -v -w FETCH_HEAD abcd1234 http://127.0.0.1/repo.git/
Resume an interrupted pull
git http-fetch --recover abcd1234 http://127.0.0.1/repo.git/
Read SHA/ref pairs from stdin
echo 'abcd1234 refs/heads/main' | git http-fetch --stdin http://127.0.0.1/repo.git/

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.