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 variable core.quotePath (see git-config(1)). this one 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. honestly this format is way better suited for being parsed by another application than lines is β€” machines eat this up. unlike in the lines format, 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 --format flag, and these are the formats that 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. 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 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 the lines format, 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 β€” true if this is a bare repository, otherwise false.
  • layout.shallow β€” true if this is a shallow repository, otherwise false.
  • 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 .git directory 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 .git directory).
  • 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 nul format:
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