Progress:
TIER 3 · MODULE 37· Expert

git repo

Newer porcelain-ish helper for repo metadata.

🎯 What & why

git repo is a newer porcelain-ish helper that prints structured repository metadata. It replaces ad-hoc grepping of git config --list and friends.

🧠 Mental model

Think of it as a typed accessor over repo facts: hash algorithm, ref format, bare/shallow/partial state. You ask for atoms, you get values - no parsing.

🛠️ Synopsis

git repo info [--format=<keyvalue|nul>] [<key>...]

Atoms include:
  references.format        # files | reftable
  layout.bare              # true | false
  layout.shallow           # true | false
  object.format            # sha1 | sha256

🎚️ Switches & options

FlagWhat it does
--format=<fmt>Output format: keyvalue (default) or nul (NUL-separated)
info <key>...Subcommand: print one or more named info atoms
references.formatAtom: ref backend (files vs reftable)
layout.bareAtom: whether the repo is bare
layout.shallowAtom: whether the repo has a shallow boundary
object.formatAtom: hash algorithm (sha1/sha256)

📦 Subcommands

info — Print specific repo info atoms
git repo info layout.bare references.format

💡 Use cases

🧪 Examples

Check ref backend
git repo info references.format
Multiple atoms
git repo info layout.bare layout.shallow object.format
NUL-separated for scripts
git repo info --format=nul references.format
Replace config grepping
git repo info layout.bare   # vs git config --bool core.bare

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.