Store refs efficiently in packed-refs.

Section: Refs and Symbolic Refs

Pack refs

bash
bash
git pack-refs --all --prune

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Refs and Symbolic Refs
List refs
List local refs and object IDs.
OpenIn sheetbashsame section
Format refs
Script-friendly ref iteration.
OpenIn sheetbashsame section
Update ref atomically
Create or move a ref directly.
OpenIn sheetbashsame section
Read symbolic ref
Print the symbolic target of HEAD.
OpenIn sheetbashsame section
Count loose objects
Show object counts and disk usage.
OpenIn sheetbash2 tag match
Write blob object
Store file content as a blob and print its object ID.
OpenIn sheetbash1 tag match