6 scalar - A tool for managing large Git repositories
11 scalar clone [--single-branch] [--branch <main-branch>] [--full-clone] <url> [<enlistment>]
13 scalar register [<enlistment>]
14 scalar unregister [<enlistment>]
15 scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]
16 scalar reconfigure [ --all | <enlistment> ]
17 scalar diagnose [<enlistment>]
18 scalar delete <enlistment>
23 Scalar is a repository management tool that optimizes Git for use in large
24 repositories. Scalar improves performance by configuring advanced Git settings,
25 maintaining repositories in the background, and helping to reduce data sent
28 An important Scalar concept is the enlistment: this is the top-level directory
29 of the project. It usually contains the subdirectory `src/` which is a Git
30 worktree. This encourages the separation between tracked files (inside `src/`)
31 and untracked files, such as build artifacts (outside `src/`). When registering
32 an existing Git worktree with Scalar whose name is not `src`, the enlistment
33 will be identical to the worktree.
35 The `scalar` command implements various subcommands, and different options
36 depending on the subcommand. With the exception of `clone`, `list` and
37 `reconfigure --all`, all subcommands expect to be run in an enlistment.
39 The following options can be specified _before_ the subcommand:
42 Before running the subcommand, change the working directory. This
43 option imitates the same option of linkgit:git[1].
46 For the duration of running the specified subcommand, configure this
47 setting. This option imitates the same option of linkgit:git[1].
55 clone [<options>] <url> [<enlistment>]::
56 Clones the specified repository, similar to linkgit:git-clone[1]. By
57 default, only commit and tree objects are cloned. Once finished, the
58 worktree is located at `<enlistment>/src`.
60 The sparse-checkout feature is enabled (except when run with `--full-clone`)
61 and the only files present are those in the top-level directory. Use
62 `git sparse-checkout set` to expand the set of directories you want to see,
63 or `git sparse-checkout disable` to expand to all files (see
64 linkgit:git-sparse-checkout[1] for more details). You can explore the
65 subdirectories outside your sparse-checkout by using `git ls-tree
70 Instead of checking out the branch pointed to by the cloned
71 repository's HEAD, check out the `<name>` branch instead.
73 --[no-]single-branch::
74 Clone only the history leading to the tip of a single branch, either
75 specified by the `--branch` option or the primary branch remote's
78 Further fetches into the resulting repository will only update the
79 remote-tracking branch for the branch this option was used for the initial
80 cloning. If the HEAD at the remote did not point at any branch when
81 `--single-branch` clone was made, no remote-tracking branch is created.
84 A sparse-checkout is initialized by default. This behavior can be
85 turned off via `--full-clone`.
91 List enlistments that are currently registered by Scalar. This
92 subcommand does not need to be run inside an enlistment.
97 register [<enlistment>]::
98 Adds the enlistment's repository to the list of registered repositories
99 and starts background maintenance. If `<enlistment>` is not provided,
100 then the enlistment associated with the current working directory is
103 Note: when this subcommand is called in a worktree that is called `src/`, its
104 parent directory is considered to be the Scalar enlistment. If the worktree is
105 _not_ called `src/`, it itself will be considered to be the Scalar enlistment.
110 unregister [<enlistment>]::
111 Remove the specified repository from the list of repositories
112 registered with Scalar and stop the scheduled background maintenance.
117 scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]::
118 Run the given maintenance task (or all tasks, if `all` was specified).
119 Except for `all` and `config`, this subcommand simply hands off to
120 linkgit:git-maintenance[1] (mapping `fetch` to `prefetch` and
121 `pack-files` to `incremental-repack`).
123 These tasks are run automatically as part of the scheduled maintenance,
124 as soon as the repository is registered with Scalar. It should therefore
125 not be necessary to run this subcommand manually.
127 The `config` task is specific to Scalar and configures all those
128 opinionated default settings that make Git work more efficiently with
129 large repositories. As this task is run as part of `scalar clone`
130 automatically, explicit invocations of this task are rarely needed.
135 After a Scalar upgrade, or when the configuration of a Scalar enlistment
136 was somehow corrupted or changed by mistake, this subcommand allows to
137 reconfigure the enlistment.
139 With the `--all` option, all enlistments currently registered with Scalar
140 will be reconfigured. Use this option after each Scalar upgrade.
145 diagnose [<enlistment>]::
146 When reporting issues with Scalar, it is often helpful to provide the
147 information gathered by this command, including logs and certain
148 statistics describing the data shape of the current enlistment.
150 The output of this command is a `.zip` file that is written into
151 a directory adjacent to the worktree in the `src` directory.
156 delete <enlistment>::
157 This subcommand lets you delete an existing Scalar enlistment from your
158 local file system, unregistering the repository.
162 linkgit:git-clone[1], linkgit:git-maintenance[1].
166 Part of the linkgit:git[1] suite