Home Explore Blog CI



git

2nd chunk of `Documentation/config/extensions.adoc`
bf296e86d86600cd75d66d1e190d0a5be25e57e581d500450000000100000c1c
 format-1 compatibility.

objectFormat::
	Specify the hash algorithm to use.  The acceptable values are `sha1` and
	`sha256`.  If not specified, `sha1` is assumed.
+
Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1].  Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.

partialClone::
	When enabled, indicates that the repo was created with a partial clone
	(or later performed a partial fetch) and that the remote may have
	omitted sending certain unwanted objects.  Such a remote is called a
	"promisor remote" and it promises that all such omitted objects can
	be fetched from it in the future.
+
The value of this key is the name of the promisor remote.
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.

preciousObjects::
	If enabled, indicates that objects in the repository MUST NOT be deleted
	(e.g., by `git-prune` or `git repack -d`).
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.

refStorage::
	Specify the ref storage format to use. The acceptable values are:
+
include::../ref-storage-format.adoc[]

+
Note that this setting should only be set by linkgit:git-init[1] or
linkgit:git-clone[1]. Trying to change it after initialization will not
work and will produce hard-to-diagnose issues.

relativeWorktrees::
	If enabled, indicates at least one worktree has been linked with
	relative paths. Automatically set if a worktree has been created or
	repaired with either the `--relative-paths` option or with the
	`worktree.useRelativePaths` config set to `true`.

worktreeConfig::
	If enabled, then worktrees will load config settings from the
	`$GIT_DIR/config.worktree` file in addition to the
	`$GIT_COMMON_DIR/config` file. Note that `$GIT_COMMON_DIR` and
	`$GIT_DIR` are the same for the main working tree, while other
	working trees have `$GIT_DIR` equal to
	`$GIT_COMMON_DIR/worktrees/<id>/`. The settings in the
	`config.worktree` file will override settings from any other
	config files.
+
When enabling this extension, you must be careful to move
certain values from the common config file to the main working tree's
`config.worktree` file, if present:
+
* `core.worktree` must be moved from `$GIT_COMMON_DIR/config` to
  `$GIT_COMMON_DIR/config.worktree`.
* If `core.bare` is true, then it must be moved from `$GIT_COMMON_DIR/config`
  to `$GIT_COMMON_DIR/config.worktree`.

+
It may also be beneficial to adjust the locations of `core.sparseCheckout`
and `core.sparseCheckoutCone` depending on your desire for customizable
sparse-checkout settings for each worktree. By default, the `git
sparse-checkout` builtin enables this extension, assigns
these config values on a per-worktree basis, and uses the
`$GIT_DIR/info/sparse-checkout` file to specify the sparsity for each
worktree independently. See linkgit:git-sparse-checkout[1] for more
details.
+
For historical reasons, this extension is respected regardless of the
`core.repositoryFormatVersion` setting.
--

Title: Git Repository Extensions and Configurations
Summary
This section describes various extensions and configurations for Git repositories, including object formats, partial clones, ref storage, and worktree configurations, which can affect how the repository behaves and interacts with other repositories and worktrees.