SYNOPSIS
gitrepoinfo[--format=(lines|nul) |-z] [--all| <key>…]gitrepoinfo--keys[--format=(lines|nul) |-z]gitrepostructure[--format=(table|lines|nul) |-z]
DESCRIPTION
Retrieve information about the repository.
THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
COMMANDS
info[--format=(lines|nul) |-z] [--all| <key>...]-
Retrieve metadata-related information about the current repository. Only the requested data will be returned based on their keys (see "INFO KEYS" section below).
The values are returned in the same order in which their respective keys were requested. The
--allflag requests the values for all the available keys.The output format can be chosen through the flag
--format. Two formats are supported:lines-
Output key-value pairs one per line using the
=character as the delimiter between the key and the value. Values containing "unusual" characters are quoted as explained for the configuration variablecore.quotePath(see git-config(1)). This is the default. nul-
Similar to
lines, but using a newline character as the delimiter between the key and the value and using a NUL character after each value. This format is better suited for being parsed by another applications thanlines. Unlike in thelinesformat, the values are never quoted.-zis an alias for--format=nul.
info--keys[--format=(lines|nul) |-z]-
List all the available keys, one per line. The output format can be chosen through the flag
--format. The following formats are supported:lines-
Output the keys one per line. This is the default.
nul-
Similar to
lines, but using a NUL character after each value.
structure[--format=(table|lines|nul) |-z]-
Retrieve statistics about the current repository structure. The following kinds of information are reported:
-
Reference counts categorized by type
-
Reachable object counts categorized by type
-
Total inflated size of reachable objects by type
-
Total disk size of reachable objects by type
-
Largest reachable objects in the repository by type
The output format can be chosen through the flag
--format. Three formats are supported:table-
Outputs repository stats in a human-friendly table. This format may change and is not intended for machine parsing. This is the default format.
lines-
Each line of output contains a key-value pair for a repository stat. The = character is used to delimit between the key and the value. Values containing "unusual" characters are quoted as explained for the configuration variable
core.quotePath(see git-config(1)). nul-
Similar to
lines, but uses a NUL character to delimit between key-value pairs instead of a newline. Also uses a newline character as the delimiter between the key and value instead of =. Unlike thelinesformat, values containing "unusual" characters are never quoted.-zis an alias for--format=nul.
-
INFO KEYS
In order to obtain a set of values from git repo info, you should provide
the keys that identify them. Here’s a list of the available keys and the
values that they return:
layout.bare-
trueif this is a bare repository, otherwisefalse. layout.shallow-
trueif this is a shallow repository, otherwisefalse. object.format-
The object format (hash algorithm) used in the repository.
objects.storageFormat-
The object storage format used in the repository, as configured via
extensions.objectStorage. The valid values are:files[://<path>]-
for loose objects and packfiles. This is the default.
The optional payload can be passed to specify an alternative filesystem path where the objects will be stored. Relative paths are resolved relative to the
$GIT_COMMON_DIR. Defaults to$GIT_COMMON_DIR/objectswhen no payload is provided. The payload is ignored whenGIT_OBJECT_DIRECTORYis set.
path.commondir.absolute-
The canonical absolute path to the Git repository’s common directory (the shared .
gitdirectory containing objects, refs, and global configuration). path.commondir.relative-
The path to the Git repository’s common directory relative to the current working directory.
path.gitdir.absolute-
The canonical absolute path to the Git repository directory (the .
gitdirectory). path.gitdir.relative-
The path to the Git repository directory relative to the current working directory.
path.index.absolute-
The canonical absolute path to the repository’s current index file. Respects the
GIT_INDEX_FILEenvironment override. Returns the configured index path even if the repository is bare or the file does not exist. path.index.relative-
The path to the repository’s current index file relative to the current working directory. Respects the
GIT_INDEX_FILEenvironment override. Returns the configured index path even if the repository is bare or the file does not exist. path.prefix-
The path from the root of the working tree to the current working directory. Returns the empty string when the current working directory is the root of the working tree.
path.superprojectworkingtree.absolute-
The canonical absolute path to the working tree root of the superproject if the current repository is an initialized submodule. Outputs an empty string if not in a submodule.
path.superprojectworkingtree.relative-
The path to the working tree root of the superproject relative to the current working directory if the current repository is an initialized submodule. Outputs an empty string if not in a submodule.
path.workingtree.absolute-
The canonical absolute path to the top-level directory of the repository’s working tree. Outputs an empty string if the repository is bare.
path.workingtree.relative-
The path to the top-level directory of the repository’s working tree relative to the current working directory. Outputs an empty string if the repository is bare.
references.storageFormat-
The reference storage format. The valid values are:
files-
for loose files with packed-refs. This is the default.
reftable-
for the reftable format.
EXAMPLES
-
Retrieves the reference storage format of the current repository:
git repo info references.storageFormat
-
Retrieves whether the current repository is bare and whether it is shallow using the
nulformat:git repo info --format=nul layout.bare layout.shallow
SEE ALSO
GIT
Part of the git(1) suite