GIT-REPO(1)
π GIT-REPO(1) π
okay so this is a page from the Git Manual β yes, that Git Manual β and it's literally all about git-repo, the command that spills the tea about your repository. π«β¨
β¨ NAME β¨
git-repo β retrieve information about the repository π
π SYNOPSIS π
git repo info [--format=(lines|nul) | -z] [--all | <key>...]
git repo info --keys [--format=(lines|nul) | -z]
git repo structure [--format=(table|lines|nul) | -z]
πΈ DESCRIPTION πΈ
Retrieve information about the repository. that's it, that's the whole vibe. π
β οΈ THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE. like bestie this is not the moment to build your entire toolchain's future on it, okay? it might switch up on you. π
π¦ COMMANDS π¦
info [--format=(lines|nul) | -z] [--all | <key>...]β retrieve metadata-related information about the current repository. only the data you actually asked for comes back, based on their keys (peep the "INFO KEYS" section below π).
the values come back in the exact same order you requested the keys in β order is preserved, no cap. and the --all flag is like "give me everything", it requests the values for all the available keys. π
the output format is yours to choose through the --format flag. 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(seegit-config(1)). this one is the default. πnulβ similar tolines, but using a newline character as the delimiter between the key and the value, and using a NUL character after each value. honestly this format is way better suited for being parsed by another application thanlinesis β machines eat this up. unlike in thelinesformat, the values are never quoted. π€
-z is an alias for --format=nul. iykyk. β¨
info --keys [--format=(lines|nul) | -z]β list all the available keys, one per line. the output format can be chosen through the--formatflag, and these are the formats that are supported:linesβ output the keys one per line. this is the default. πnulβ similar tolines, but using a NUL character after each value.
structure [--format=(table|lines|nul) | -z]β retrieve statistics about the current repository structure. here's the kinds of info that gets reported, bestie:- 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 --format flag. three formats are supported:
tableβ outputs repository stats in a human-friendly table. this format may change and is not intended for machine parsing. it's the default format. it's giving β¨aestheticβ¨ not β¨APIβ¨.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 variablecore.quotePath(seegit-config(1)).nulβ similar tolines, 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.
-z is an alias for --format=nul. π
π INFO KEYS π
so to get a set of values out of git repo info, you gotta hand over the keys that identify them. here's the full list of available keys and the values they return β no gatekeeping, we share everything in this group chat π:
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.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.references.formatβ 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 format of the current repository:
git repo info references.format
- 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-rev-parse(1) β go look at that one too, it's lowkey iconic π§
π GIT π
part of the git(1) suite β one of the squad, fr fr. ππ₯
and that's the whole page bestie!! brought to you by Git 2.56.0, dated 2026-09-27 β screenshot it, frame it, put it on your wall ππ«Άβ¨
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms