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 By default, `scalar clone` will fetch the tag objects advertised by
91 the remote and future `git fetch` commands will do the same. Use
92 `--no-tags` to avoid fetching tags in `scalar clone` and to configure
93 the repository to avoid fetching tags in the future. To fetch tags after
94 cloning with `--no-tags`, run `git fetch --tags`.
97 A sparse-checkout is initialized by default. This behavior can be
98 turned off via `--full-clone`.
104 List enlistments that are currently registered by Scalar. This
105 subcommand does not need to be run inside an enlistment.
110 register [<enlistment>]::
111 Adds the enlistment's repository to the list of registered repositories
112 and starts background maintenance. If `<enlistment>` is not provided,
113 then the enlistment associated with the current working directory is
116 Note: when this subcommand is called in a worktree that is called `src/`, its
117 parent directory is considered to be the Scalar enlistment. If the worktree is
118 _not_ called `src/`, it itself will be considered to be the Scalar enlistment.
123 unregister [<enlistment>]::
124 Remove the specified repository from the list of repositories
125 registered with Scalar and stop the scheduled background maintenance.
130 scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]::
131 Run the given maintenance task (or all tasks, if `all` was specified).
132 Except for `all` and `config`, this subcommand simply hands off to
133 linkgit:git-maintenance[1] (mapping `fetch` to `prefetch` and
134 `pack-files` to `incremental-repack`).
136 These tasks are run automatically as part of the scheduled maintenance,
137 as soon as the repository is registered with Scalar. It should therefore
138 not be necessary to run this subcommand manually.
140 The `config` task is specific to Scalar and configures all those
141 opinionated default settings that make Git work more efficiently with
142 large repositories. As this task is run as part of `scalar clone`
143 automatically, explicit invocations of this task are rarely needed.
148 After a Scalar upgrade, or when the configuration of a Scalar enlistment
149 was somehow corrupted or changed by mistake, this subcommand allows to
150 reconfigure the enlistment.
152 With the `--all` option, all enlistments currently registered with Scalar
153 will be reconfigured. Use this option after each Scalar upgrade.
158 diagnose [<enlistment>]::
159 When reporting issues with Scalar, it is often helpful to provide the
160 information gathered by this command, including logs and certain
161 statistics describing the data shape of the current enlistment.
163 The output of this command is a `.zip` file that is written into
164 a directory adjacent to the worktree in the `src` directory.
169 delete <enlistment>::
170 This subcommand lets you delete an existing Scalar enlistment from your
171 local file system, unregistering the repository.
175 linkgit:git-clone[1], linkgit:git-maintenance[1].
179 Part of the linkgit:git[1] suite