{
    "content": [
        {
            "type": "text",
            "text": "# git-upload-pack(1) (man)\n\n**Summary:** git-upload-pack - Send objects packed back to git-fetch-pack\n\n**Synopsis:** git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n[--advertise-refs] <directory>\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --stateless-rpc | — | Perform only a single read-write cycle with stdin and stdout. This fits with the HTTP POST request processing model wher |\n| — | --http-backend-info-refs | — | Used by git-http-backend(1) to serve up $GITURL/info/refs?service=git-upload-pack requests. See \"Smart Clients\" in the H |\n\n## See Also\n\n- gitnamespaces(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (7 lines)\n- **OPTIONS** (6 lines) — 2 subsections\n  - --stateless-rpc (4 lines)\n  - --http-backend-info-refs (8 lines)\n- **ENVIRONMENT** (17 lines)\n- **SEE ALSO** (2 lines)\n- **GIT** (2 lines)\n- **NOTES** (9 lines)\n\n## Full Content\n\n### NAME\n\ngit-upload-pack - Send objects packed back to git-fetch-pack\n\n### SYNOPSIS\n\ngit-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n[--advertise-refs] <directory>\n\n### DESCRIPTION\n\nInvoked by git fetch-pack, learns what objects the other side is missing, and sends them\nafter packing.\n\nThis command is usually not invoked directly by the end user. The UI for the protocol is on\nthe git fetch-pack side, and the program pair is meant to be used to pull updates from a\nremote repository. For push operations, see git send-pack.\n\n### OPTIONS\n\n--[no-]strict\nDo not try <directory>/.git/ if <directory> is no Git directory.\n\n--timeout=<n>\nInterrupt transfer after <n> seconds of inactivity.\n\n#### --stateless-rpc\n\nPerform only a single read-write cycle with stdin and stdout. This fits with the HTTP\nPOST request processing model where a program may read the request, write a response, and\nmust exit.\n\n#### --http-backend-info-refs\n\nUsed by git-http-backend(1) to serve up $GITURL/info/refs?service=git-upload-pack\nrequests. See \"Smart Clients\" in the HTTP transfer protocols[1] documentation and \"HTTP\nTransport\" in the Git Wire Protocol, Version 2[2] documentation. Also understood by git-\nreceive-pack(1).\n\n<directory>\nThe repository to sync from.\n\n### ENVIRONMENT\n\nGITPROTOCOL\nInternal variable used for handshaking the wire protocol. Server admins may need to\nconfigure some transports to allow this variable to be passed. See the discussion in\ngit(1).\n\nGITNOLAZYFETCH\nWhen cloning or fetching from a partial repository (i.e., one itself cloned with\n--filter), the server-side upload-pack may need to fetch extra objects from its upstream\nin order to complete the request. By default, upload-pack will refuse to perform such a\nlazy fetch, because git fetch may run arbitrary commands specified in configuration and\nhooks of the source repository (and upload-pack tries to be safe to run even in untrusted\n.git directories).\n\nThis is implemented by having upload-pack internally set the GITNOLAZYFETCH variable\nto 1. If you want to override it (because you are fetching from a partial clone, and you\nare sure you trust it), you can explicitly set GITNOLAZYFETCH to 0.\n\n### SEE ALSO\n\ngitnamespaces(7)\n\n### GIT\n\nPart of the git(1) suite\n\n### NOTES\n\n1. the HTTP transfer protocols\nfile:///usr/share/doc/git/html/technical/http-protocol.html\n\n2. the Git Wire Protocol, Version 2\nfile:///usr/share/doc/git/html/technical/protocol-v2.html\n\n\n\nGit 2.34.1                                   02/26/2026                           GIT-UPLOAD-PACK(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "git-upload-pack",
        "section": "1",
        "mode": "man",
        "summary": "git-upload-pack - Send objects packed back to git-fetch-pack",
        "synopsis": "git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n[--advertise-refs] <directory>",
        "flags": [
            {
                "flag": "",
                "long": "--stateless-rpc",
                "arg": null,
                "description": "Perform only a single read-write cycle with stdin and stdout. This fits with the HTTP POST request processing model where a program may read the request, write a response, and must exit."
            },
            {
                "flag": "",
                "long": "--http-backend-info-refs",
                "arg": null,
                "description": "Used by git-http-backend(1) to serve up $GITURL/info/refs?service=git-upload-pack requests. See \"Smart Clients\" in the HTTP transfer protocols[1] documentation and \"HTTP Transport\" in the Git Wire Protocol, Version 2[2] documentation. Also understood by git- receive-pack(1). <directory> The repository to sync from."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "gitnamespaces",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/gitnamespaces/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 6,
                "subsections": [
                    {
                        "name": "--stateless-rpc",
                        "lines": 4,
                        "long": "--stateless-rpc"
                    },
                    {
                        "name": "--http-backend-info-refs",
                        "lines": 8,
                        "long": "--http-backend-info-refs"
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}