Git fork
at reftables-rust 206 lines 7.4 kB view raw
1scalar(1) 2========= 3 4NAME 5---- 6scalar - A tool for managing large Git repositories 7 8SYNOPSIS 9-------- 10[verse] 11scalar clone [--single-branch] [--branch <main-branch>] [--full-clone] 12 [--[no-]src] [--[no-]tags] [--[no-]maintenance] <url> [<enlistment>] 13scalar list 14scalar register [--[no-]maintenance] [<enlistment>] 15scalar unregister [<enlistment>] 16scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>] 17scalar reconfigure [--maintenance=(enable|disable|keep)] [ --all | <enlistment> ] 18scalar diagnose [<enlistment>] 19scalar delete <enlistment> 20 21DESCRIPTION 22----------- 23 24Scalar is a repository management tool that optimizes Git for use in large 25repositories. Scalar improves performance by configuring advanced Git settings, 26maintaining repositories in the background, and helping to reduce data sent 27across the network. 28 29An important Scalar concept is the enlistment: this is the top-level directory 30of the project. It usually contains the subdirectory `src/` which is a Git 31worktree. This encourages the separation between tracked files (inside `src/`) 32and untracked files, such as build artifacts (outside `src/`). When registering 33an existing Git worktree with Scalar whose name is not `src`, the enlistment 34will be identical to the worktree. 35 36The `scalar` command implements various subcommands, and different options 37depending on the subcommand. With the exception of `clone`, `list` and 38`reconfigure --all`, all subcommands expect to be run in an enlistment. 39 40The following options can be specified _before_ the subcommand: 41 42-C <directory>:: 43 Before running the subcommand, change the working directory. This 44 option imitates the same option of linkgit:git[1]. 45 46-c <key>=<value>:: 47 For the duration of running the specified subcommand, configure this 48 setting. This option imitates the same option of linkgit:git[1]. 49 50COMMANDS 51-------- 52 53Clone 54~~~~~ 55 56clone [<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`. 60+ 61The sparse-checkout feature is enabled (except when run with `--full-clone`) 62and 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, 64or `git sparse-checkout disable` to expand to all files (see 65linkgit:git-sparse-checkout[1] for more details). You can explore the 66subdirectories outside your sparse-checkout by using `git ls-tree 67HEAD[:<directory>]`. 68 69-b <name>:: 70--branch <name>:: 71 Instead of checking out the branch pointed to by the cloned 72 repository's HEAD, check out the `<name>` branch instead. 73 74--single-branch:: 75--no-single-branch:: 76 Clone only the history leading to the tip of a single branch, either 77 specified by the `--branch` option or the primary branch remote's 78 `HEAD` points at. 79+ 80Further fetches into the resulting repository will only update the 81remote-tracking branch for the branch this option was used for the initial 82cloning. If the HEAD at the remote did not point at any branch when 83`--single-branch` clone was made, no remote-tracking branch is created. 84 85--src:: 86--no-src:: 87 By default, `scalar clone` places the cloned repository within a 88 `<entlistment>/src` directory. Use `--no-src` to place the cloned 89 repository directly in the `<enlistment>` directory. 90 91--tags:: 92--no-tags:: 93 By default, `scalar clone` will fetch the tag objects advertised by 94 the remote and future `git fetch` commands will do the same. Use 95 `--no-tags` to avoid fetching tags in `scalar clone` and to configure 96 the repository to avoid fetching tags in the future. To fetch tags after 97 cloning with `--no-tags`, run `git fetch --tags`. 98 99--full-clone:: 100--no-full-clone:: 101 A sparse-checkout is initialized by default. This behavior can be 102 turned off via `--full-clone`. 103 104--maintenance:: 105--no-maintenance:: 106 By default, `scalar clone` configures the enlistment to use Git's 107 background maintenance feature. Use the `--no-maintenance` to skip 108 this configuration. 109 110List 111~~~~ 112 113list:: 114 List enlistments that are currently registered by Scalar. This 115 subcommand does not need to be run inside an enlistment. 116 117Register 118~~~~~~~~ 119 120register [<enlistment>]:: 121 Adds the enlistment's repository to the list of registered repositories 122 and starts background maintenance. If `<enlistment>` is not provided, 123 then the enlistment associated with the current working directory is 124 registered. 125+ 126Note: when this subcommand is called in a worktree that is called `src/`, its 127parent directory is considered to be the Scalar enlistment. If the worktree is 128_not_ called `src/`, it itself will be considered to be the Scalar enlistment. 129 130--maintenance:: 131--no-maintenance:: 132 By default, `scalar register` configures the enlistment to use Git's 133 background maintenance feature. Use the `--no-maintenance` to skip 134 this configuration. This does not disable any maintenance that may 135 already be enabled in other ways. 136 137Unregister 138~~~~~~~~~~ 139 140unregister [<enlistment>]:: 141 Remove the specified repository from the list of repositories 142 registered with Scalar and stop the scheduled background maintenance. 143 144Run 145~~~ 146 147scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]:: 148 Run the given maintenance task (or all tasks, if `all` was specified). 149 Except for `all` and `config`, this subcommand simply hands off to 150 linkgit:git-maintenance[1] (mapping `fetch` to `prefetch` and 151 `pack-files` to `incremental-repack`). 152+ 153These tasks are run automatically as part of the scheduled maintenance, 154as soon as the repository is registered with Scalar. It should therefore 155not be necessary to run this subcommand manually. 156+ 157The `config` task is specific to Scalar and configures all those 158opinionated default settings that make Git work more efficiently with 159large repositories. As this task is run as part of `scalar clone` 160automatically, explicit invocations of this task are rarely needed. 161 162Reconfigure 163~~~~~~~~~~~ 164 165After a Scalar upgrade, or when the configuration of a Scalar enlistment 166was somehow corrupted or changed by mistake, this subcommand allows to 167reconfigure the enlistment. 168 169--all:: 170 When `--all` is specified, reconfigure all enlistments currently 171 registered with Scalar by the `scalar.repo` config key. Use this 172 option after each upgrade to get the latest features. 173 174--maintenance=(enable|disable|keep):: 175 By default, Scalar configures the enlistment to use Git's 176 background maintenance feature; this is the same as using the 177 `enable` value for this option. Use the `disable` value to 178 remove each considered enlistment from background maintenance. 179 Use `keep' to leave the background maintenance configuration 180 untouched for these repositories. 181 182Diagnose 183~~~~~~~~ 184 185diagnose [<enlistment>]:: 186 When reporting issues with Scalar, it is often helpful to provide the 187 information gathered by this command, including logs and certain 188 statistics describing the data shape of the current enlistment. 189+ 190The output of this command is a `.zip` file that is written into 191a directory adjacent to the worktree in the `src` directory. 192 193Delete 194~~~~~~ 195 196delete <enlistment>:: 197 This subcommand lets you delete an existing Scalar enlistment from your 198 local file system, unregistering the repository. 199 200SEE ALSO 201-------- 202linkgit:git-clone[1], linkgit:git-maintenance[1]. 203 204GIT 205--- 206Part of the linkgit:git[1] suite