Setup and Config
Getting and Creating Projects
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- All guides...
- 2.43.0 no changes
- 2.42.1 11/02/23
scalar clone [--single-branch] [--branch <main-branch>] [--full-clone] [--[no-]src] <url> [<enlistment>] scalar list scalar register [<enlistment>] scalar unregister [<enlistment>] scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>] scalar reconfigure [ --all | <enlistment> ] scalar diagnose [<enlistment>] scalar delete <enlistment>
Scalar is a repository management tool that optimizes Git for use in large repositories. Scalar improves performance by configuring advanced Git settings, maintaining repositories in the background, and helping to reduce data sent across the network.
An important Scalar concept is the enlistment: this is the top-level directory
of the project. It usually contains the subdirectory
src/ which is a Git
worktree. This encourages the separation between tracked files (inside
and untracked files, such as build artifacts (outside
src/). When registering
an existing Git worktree with Scalar whose name is not
src, the enlistment
will be identical to the worktree.
scalar command implements various subcommands, and different options
depending on the subcommand. With the exception of
reconfigure --all, all subcommands expect to be run in an enlistment.
The following options can be specified before the subcommand:
- clone [<options>] <url> [<enlistment>]
Clones the specified repository, similar to git-clone. By default, only commit and tree objects are cloned. Once finished, the worktree is located at
The sparse-checkout feature is enabled (except when run with
--full-clone) and the only files present are those in the top-level directory. Use
git sparse-checkout setto expand the set of directories you want to see, or
git sparse-checkout disableto expand to all files (see git-sparse-checkout for more details). You can explore the subdirectories outside your sparse-checkout by using
git ls-tree HEAD[:<directory>].
- -b <name>
- --branch <name>
Instead of checking out the branch pointed to by the cloned repository’s HEAD, check out the
Clone only the history leading to the tip of a single branch, either specified by the
--branchoption or the primary branch remote’s
Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when
--single-branchclone was made, no remote-tracking branch is created.
scalar cloneplaces the cloned repository within a
--no-srcto place the cloned repository directly in the
A sparse-checkout is initialized by default. This behavior can be turned off via
- register [<enlistment>]
Adds the enlistment’s repository to the list of registered repositories and starts background maintenance. If
<enlistment>is not provided, then the enlistment associated with the current working directory is registered.
Note: when this subcommand is called in a worktree that is called
src/, its parent directory is considered to be the Scalar enlistment. If the worktree is not called
src/, it itself will be considered to be the Scalar enlistment.
- scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]
Run the given maintenance task (or all tasks, if
allwas specified). Except for
config, this subcommand simply hands off to git-maintenance (mapping
These tasks are run automatically as part of the scheduled maintenance, as soon as the repository is registered with Scalar. It should therefore not be necessary to run this subcommand manually.
configtask is specific to Scalar and configures all those opinionated default settings that make Git work more efficiently with large repositories. As this task is run as part of
scalar cloneautomatically, explicit invocations of this task are rarely needed.
After a Scalar upgrade, or when the configuration of a Scalar enlistment was somehow corrupted or changed by mistake, this subcommand allows to reconfigure the enlistment.
--all option, all enlistments currently registered with Scalar
will be reconfigured. Use this option after each Scalar upgrade.
- diagnose [<enlistment>]
When reporting issues with Scalar, it is often helpful to provide the information gathered by this command, including logs and certain statistics describing the data shape of the current enlistment.
The output of this command is a
.zipfile that is written into a directory adjacent to the worktree in the
Part of the git suite