GITPROTOCOL-HTTP(5) Git Manual GITPROTOCOL-HTTP(5) (NAME) gitprotocol-http - HTTP (SYNOPSIS) (DESCRIPTION) HTTP : <<>> (dumb) HTTP <<>> (smart) CGI . . URL <<>> URL <<>> . URL (peers) . (URL FORMAT) (URL) HTTP HTTP URL RFC 1738 : http://:/? $GIT_URL http:// . $GIT_URL HTTP <<>> <<>> $GIT_URL . (loose object) : $GIT_URL: http://example.com:8080/git/repo.git URL request: http://example.com:8080/git/repo.git/objects/d0/49f6c27a2244e12041955e262a404c7faba355 (catch-all gateway): $GIT_URL: http://example.com/daemon.cgi?svc=git&q= URL request: http://example.com/daemon.cgi?svc=git&q=/info/refs&service=git-receive-pack (submodule): $GIT_URL: http://example.com/git/repo.git/path/submodule.git URL request: http://example.com/git/repo.git/path/submodule.git/info/refs / $GIT_URL (//) URL . $GIT_URL/info/refs foo/info/refs foo//info/refs. (AUTHENTICATION) HTTP HTTP . HTTP . (Basic authentication) RFC 2617 . HTTP Basic . HTTP . HTTP (Digest authentication) . (SSL) SSL Basic HTTP. (SESSION STATE) HTTP ( HTTP) HTTP (stateless) . . (round-robin load-balancing) . . HTTP . RFC 2616 (HTTP/1.1) HTTP . . (GENERAL REQUEST PROCESSING) HTTP . ( ): $GIT_URL $GIT_URL 200 OK . 404 Not Found 410 Gone HTTP . $GIT_URL HTTP 403 Forbidden . HTTP 1.0 HTTP 1.1 . (chunked encoding) . HTTP 1.0 HTTP 1.1 . (chunked encoding) . ETag / Last-Modified . If-Modified-Since / If-None-Match () . 304 Not Modified . 304 Not Modified 200 OK . Cache-Control / Expires . RFC 2616 . (DISCOVERING REFERENCES) HTTP (fetch) (push) . (Dumb Clients) HTTP <<>> info/refs . HTTP GET $GIT_URL/info/refs (query parameter) . C: GET $GIT_URL/info/refs HTTP/1.0 S: 200 OK S: S: 95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master S: 2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0 S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{} Content-Type info/refs text/plain; charset=utf-8 . Content-Type . application/x-git- . Cache-Control . HTTP . 200 OK 304 Not Modified . (ref) . C locale . HEAD . info_refs = *( ref_record ) ref_record = any_ref / peeled_ref any_ref = obj-id HTAB refname LF peeled_ref = obj-id HTAB refname LF obj-id HTAB refname "^{}" LF (Smart Clients) HTTP <<>> ( <<>> <<>>) info/refs . : service=$servicename $servicename . . C: GET $GIT_URL/info/refs?service=git-upload-pack HTTP/1.0 : S: 200 OK S: S: 95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master S: 2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0 S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{} : S: 200 OK S: Content-Type: application/x-git-upload-pack-advertisement S: Cache-Control: no-cache S: S: 001e# service=git-upload-pack\n S: 0000 S: 004895dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint\0multi_ack\n S: 003fd049f6c27a2244e12041955e262a404c7faba355 refs/heads/master\n S: 003c2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0\n S: 003fa3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}\n S: 0000 (Extra Parameters - gitprotocol-pack(5) ) HTTP Git-Protocol . --http-backend-info-refs git-upload-pack(1) . . . HTTP 403 Forbidden . . Cache-Control . Content-Type application/x-$servicename-advertisement . (fall back). $GIT_URL/info/refs . . 200 OK 304 Not Modified . ^[0-9a-f]{4}# . . pkt-line . pkt-line # service=$servicename . $servicename . LF . LF . pkt-line 0000 . pkt-line . C locale . HEAD . (capabilities) NUL . "version=1" "version 1" . smart_reply = PKT-LINE("# service=$servicename" LF) "0000" *1("version 1") ref_list "0000" ref_list = empty_list / non_empty_list empty_list = PKT-LINE(zero-id SP "capabilities^{}" NUL cap-list LF) non_empty_list = PKT-LINE(obj-id SP name NUL cap_list LF) *ref_record cap-list = capability *(SP capability) capability = 1*(LC_ALPHA / DIGIT / "-" / "_") LC_ALPHA = %x61-7A ref_record = any_ref / peeled_ref any_ref = PKT-LINE(obj-id SP name LF) peeled_ref = PKT-LINE(obj-id SP name LF) PKT-LINE(obj-id SP name "^{}" LF GIT-UPLOAD-PACK (SMART SERVICE GIT-UPLOAD-PACK) $GIT_URL . $GIT_URL/info/refs?service=git-upload-pack . C: POST $GIT_URL/git-upload-pack HTTP/1.0 C: Content-Type: application/x-git-upload-pack-request C: C: 0032want 0a53e9ddeaddad63ad106860237bbf53411d11a7\n C: 0032have 441b40d833fdfa93eb2908e52742248faf0ee993\n C: 0000 S: 200 OK S: Content-Type: application/x-git-upload-pack-result S: Cache-Control: no-cache S: S: ....ACK %s, continue S: ....NAK . Cache-Control . . "want" . "want" allow-tip-sha1-in-want allow-reachable-sha1-in-want . compute_request = want_list have_list request_end request_end = "0000" / "done" want_list = PKT-LINE(want SP cap_list LF) *(want_pkt) want_pkt = PKT-LINE(want LF) want = "want" SP id cap_list = capability *(SP capability) have_list = *PKT-LINE("have" SP id LF) : . (The Negotiation Algorithm) (pack) (C = S = ): : C: . C: advertised. C: common . C: want advertised . C: c_pending (commit time) ( ). . . . : C: $GIT_URL/git-upload-pack: C: 0032want ............................... C: 0032want ............................... .... C: 0032have ............................. C: 0032have ............................. .... C: 0032have ............................... C: 0032have ............................... .... C: 0000 <<>> pkt-line . LF . LF pkt-line . : o "want" o "have" pkt-line (0000). "want" "have" . . object-format ( SHA-1) . have c_pending . c_pending . "have" s_common c_pending "done" : C: 0009done S: git-upload-pack: want . reflog . "want" : : "want" . "want" : want . s_common . "have" : . s_common . s_common have . S: git-upload-pack: "done" (pack) . : S: PACK... side-band-64k git-upload-pack . . << >> "want" "common" . : : C: upload-pack: : . GIT-RECEIVE-PACK (SMART SERVICE GIT-RECEIVE-PACK) $GIT_URL . $GIT_URL/info/refs?service=git-receive-pack . C: POST $GIT_URL/git-receive-pack HTTP/1.0 C: Content-Type: application/x-git-receive-pack-request C: C: ....0a53e9ddeaddad63ad106860237bbf53411d11a7 441b40d833fdfa93eb2908e52742248faf0ee993 refs/heads/maint\0 report-status C: 0000 C: PACK.... S: 200 OK S: Content-Type: application/x-git-receive-pack-result S: Cache-Control: no-cache S: S: .... . Cache-Control . . . old_id . update_request = command_list "PACK" command_list = PKT-LINE(command NUL cap_list LF) *(command_pkt) command_pkt = PKT-LINE(command LF) cap_list = *(SP capability) SP command = create / delete / update create = zero-id SP new_id SP name delete = old_id SP zero-id SP name update = old_id SP new_id SP name : . (REFERENCES) RFC 1738: Uniform Resource Locators (URL)[1] RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1[2] (SEE ALSO) gitprotocol-pack(5) gitprotocol-capabilities(5) (GIT) git(1) (NOTES) 1. RFC 1738: Uniform Resource Locators (URL) https://www.ietf.org/rfc/rfc1738.txt 2. RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1 https://www.ietf.org/rfc/rfc2616.txt Git 2.55.0 2026-06-29 GITPROTOCOL-HTTP(5)