Progress:
TIER 3 · MODULE 51· Expert

git http-push

Object-by-object upload over plain HTTP. Almost never wanted.

🎯 What & why

git http-push uploads objects and updates refs over plain HTTP using WebDAV-style PUT/MOVE/DELETE. It is the writing counterpart to git http-fetch and exists only because dumb HTTP has no receive-pack.

🧠 Mental model

Imagine using curl -X PUT to copy each loose object into the remote's objects/ tree, then PUT-ing the new ref file. That is literally what this does. There is no negotiation, no atomic transaction, and no hooks fire on the server.

🛠️ Synopsis

git http-push [--all] [--dry-run] [--force] [--verbose]
              [-D] [-d] <url> <ref> [<ref>...]

Requires a WebDAV-enabled HTTP server. Writes objects under `objects/` and rewrites ref files under `refs/`. No server-side validation.

🎚️ Switches & options

FlagWhat it does
<url> <refs>Remote base URL and one or more refs to push (e.g. refs/heads/main).
-D⚠️ Delete the named refs on the remote (with -d, expects ref:dst form).
-dSame as -D but using the <src>:<dst> refspec form.
-f, --force⚠️ Allow non-fast-forward updates -- overwrites history on the remote.
--allPush all refs under refs/heads/.
-v, --verbosePrint each object/ref operation as it happens.
--dry-runShow what would be sent without uploading anything.

💡 Use cases

🧪 Examples

Push main over WebDAV
git http-push http://127.0.0.1/repo.git/ refs/heads/main
Force-push everything (DANGER)
git http-push --force --all http://127.0.0.1/repo.git/
Delete a remote branch
git http-push -D http://127.0.0.1/repo.git/ refs/heads/old-topic
Preview without uploading
git http-push --dry-run -v http://127.0.0.1/repo.git/ refs/heads/main

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

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