{
    "mode": "man",
    "parameter": "scalar",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/scalar/1/json",
    "generated": "2026-10-21T16:24:05Z",
    "synopsis": "scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n[--[no-]src] <url> [<enlistment>]\nscalar list\nscalar register [<enlistment>]\nscalar unregister [<enlistment>]\nscalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]\nscalar reconfigure [ --all | <enlistment> ]\nscalar diagnose [<enlistment>]\nscalar delete <enlistment>",
    "sections": {
        "NAME": {
            "content": "scalar - A tool for managing large Git repositories\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]\n[--[no-]src] <url> [<enlistment>]\nscalar list\nscalar register [<enlistment>]\nscalar unregister [<enlistment>]\nscalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]\nscalar reconfigure [ --all | <enlistment> ]\nscalar diagnose [<enlistment>]\nscalar delete <enlistment>\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Scalar is a repository management tool that optimizes Git for use in large repositories.\nScalar improves performance by configuring advanced Git settings, maintaining repositories in\nthe background, and helping to reduce data sent across the network.\n\nAn important Scalar concept is the enlistment: this is the top-level directory of the\nproject. It usually contains the subdirectory src/ which is a Git worktree. This encourages\nthe separation between tracked files (inside src/) and untracked files, such as build\nartifacts (outside src/). When registering an existing Git worktree with Scalar whose name is\nnot src, the enlistment will be identical to the worktree.\n\nThe scalar command implements various subcommands, and different options depending on the\nsubcommand. With the exception of clone, list and reconfigure --all, all subcommands expect\nto be run in an enlistment.\n\nThe following options can be specified before the subcommand:\n",
            "subsections": [
                {
                    "name": "-C <directory>",
                    "content": "Before running the subcommand, change the working directory. This option imitates the\nsame option of git(1).\n\n-c <key>=<value>\nFor the duration of running the specified subcommand, configure this setting. This option\nimitates the same option of git(1).\n",
                    "flag": "-C",
                    "arg": "<directory>"
                }
            ]
        },
        "COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "Clone",
                    "content": "clone [<options>] <url> [<enlistment>]\nClones the specified repository, similar to git-clone(1). By default, only commit and\ntree objects are cloned. Once finished, the worktree is located at <enlistment>/src.\n\nThe sparse-checkout feature is enabled (except when run with --full-clone) and the only\nfiles present are those in the top-level directory. Use git sparse-checkout set to expand\nthe set of directories you want to see, or git sparse-checkout disable to expand to all\nfiles (see git-sparse-checkout(1) for more details). You can explore the subdirectories\noutside your sparse-checkout by using git ls-tree HEAD[:<directory>].\n"
                },
                {
                    "name": "-b <name>, --branch <name>",
                    "content": "Instead of checking out the branch pointed to by the cloned repository’s HEAD, check out\nthe <name> branch instead.\n\n--[no-]single-branch\nClone only the history leading to the tip of a single branch, either specified by the\n--branch option or the primary branch remote’s HEAD points at.\n\nFurther fetches into the resulting repository will only update the remote-tracking branch\nfor the branch this option was used for the initial cloning. If the HEAD at the remote\ndid not point at any branch when --single-branch clone was made, no remote-tracking\nbranch is created.\n\n--[no-]src\nBy default, scalar clone places the cloned repository within a <entlistment>/src\ndirectory. Use --no-src to place the cloned repository directly in the <enlistment>\ndirectory.\n\n--[no-]full-clone\nA sparse-checkout is initialized by default. This behavior can be turned off via\n--full-clone.\n",
                    "flag": "-b",
                    "long": "--branch",
                    "arg": "<name>"
                },
                {
                    "name": "List",
                    "content": "list\nList enlistments that are currently registered by Scalar. This subcommand does not need\nto be run inside an enlistment.\n"
                },
                {
                    "name": "Register",
                    "content": "register [<enlistment>]\nAdds the enlistment’s repository to the list of registered repositories and starts\nbackground maintenance. If <enlistment> is not provided, then the enlistment associated\nwith the current working directory is registered.\n\nNote: when this subcommand is called in a worktree that is called src/, its parent\ndirectory is considered to be the Scalar enlistment. If the worktree is not called src/,\nit itself will be considered to be the Scalar enlistment.\n"
                },
                {
                    "name": "Unregister",
                    "content": "unregister [<enlistment>]\nRemove the specified repository from the list of repositories registered with Scalar and\nstop the scheduled background maintenance.\n"
                },
                {
                    "name": "Run",
                    "content": "scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files )\n[<enlistment>]\nRun the given maintenance task (or all tasks, if all was specified). Except for all and\nconfig, this subcommand simply hands off to git-maintenance(1) (mapping fetch to prefetch\nand pack-files to incremental-repack).\n\nThese tasks are run automatically as part of the scheduled maintenance, as soon as the\nrepository is registered with Scalar. It should therefore not be necessary to run this\nsubcommand manually.\n\nThe config task is specific to Scalar and configures all those opinionated default\nsettings that make Git work more efficiently with large repositories. As this task is run\nas part of scalar clone automatically, explicit invocations of this task are rarely\nneeded.\n"
                },
                {
                    "name": "Reconfigure",
                    "content": "After a Scalar upgrade, or when the configuration of a Scalar enlistment was somehow\ncorrupted or changed by mistake, this subcommand allows to reconfigure the enlistment.\n\nWith the --all option, all enlistments currently registered with Scalar will be reconfigured.\nUse this option after each Scalar upgrade.\n"
                },
                {
                    "name": "Diagnose",
                    "content": "diagnose [<enlistment>]\nWhen reporting issues with Scalar, it is often helpful to provide the information\ngathered by this command, including logs and certain statistics describing the data shape\nof the current enlistment.\n\nThe output of this command is a .zip file that is written into a directory adjacent to\nthe worktree in the src directory.\n"
                },
                {
                    "name": "Delete",
                    "content": "delete <enlistment>\nThis subcommand lets you delete an existing Scalar enlistment from your local file\nsystem, unregistering the repository.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "git-clone(1), git-maintenance(1).\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\nGit 2.43.0                                   07/02/2025                                    SCALAR(1)",
            "subsections": []
        }
    },
    "summary": "scalar - A tool for managing large Git repositories",
    "flags": [
        {
            "flag": "-C",
            "long": null,
            "arg": "<directory>",
            "description": "Before running the subcommand, change the working directory. This option imitates the same option of git(1). -c <key>=<value> For the duration of running the specified subcommand, configure this setting. This option imitates the same option of git(1)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "git-clone",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-clone/1/json"
        },
        {
            "name": "git-maintenance",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/git-maintenance/1/json"
        }
    ]
}