git unpack-file writes the contents of a single blob object to a temp file and prints the path. Plumbing glue used inside mergetool wrappers and diff drivers.
🧠 Mental model
Takes a blob SHA, dumps its raw bytes to a file named .merge_file_XXXXXX in the worktree, echoes the filename. That's the entire job - you clean up after.
🛠️ Synopsis
git unpack-file <blob>
🎚️ Switches & options
Flag
What it does
<blob>
Required positional: the SHA of a blob object to materialize.
💡 Use cases
Mergetool wrappers that need the BASE/LOCAL/REMOTE blobs as on-disk files.
Custom diff drivers that shell out to a tool expecting two file paths.
One-off inspection of a historical blob without touching the working tree's tracked file.
Scripts that compare blob contents byte-for-byte using external tooling.