Switching from files to reftable, etc. Plumbing-adjacent.
git refs is the porcelain for the refs backend itself, not for individual references. It exists because Git is migrating from the ancient files backend to reftable, and someone has to drive that.
Think of it as fsck/migrate for the ref storage layer. You don't use it daily; you use it once when you flip a repo from files to reftable, or when you want to audit the backend's integrity.
git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]
git refs list
git refs verify [--strict] [--verbose]| Flag | What it does |
|---|---|
--ref-format=<fmt> | Target backend: files or reftable. The whole point of migrate. |
--no-reflog | Skip reflog entries during migration. Faster, lossy — you lose history of ref movement. |
--dry-run | Show what would happen without touching the repo. Always run this first. |
--strict | On verify, treat warnings as errors. Use in CI. |
--ref-format=files | ⚠️ Migrating back to files from reftable is supported but rarely what you want; reftable is the future. |
-v / --verbose | Print every ref touched. Useful for debugging a stuck migration. |
git refs migrate --ref-format=reftable --dry-rungit refs listgit fsck.git refs verify --strictfiles to reftable for ref-lookup performance.git fsck complained about ref storage.git refs listgit refs migrate --ref-format=reftable --dry-rungit refs migrate --ref-format=reftablegit refs verify --strict --verbose--dry-run first on anything bigger than a toy repo..git/ before any non-dry migration. It's cheap, the migration isn't transactional in the way you'd hope.reftable for repos with >10k refs — lookups go from O(n) directory scans to indexed reads.reftable. Migrate the server, not just the client, or your tooling breaks.--no-reflog discards the audit trail. Don't use it on a repo where you investigate force-pushes..git/refs/) assume the files layout and silently break post-migration.Hit each option, then Check answers. Score is recorded; Next is always open.