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