Git Internals and Plumbing/Write blob from stdin

Write blob content from standard input.

Section: Objects and Content Plumbing

Write blob from stdin

bash
bash
printf "hello\n" | git hash-object -w --stdin

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 Objects and Content Plumbing
Write blob object
Store file content as a blob and print its object ID.
OpenIn sheetbashsame section
Object type
Show object type.
OpenIn sheetbashsame section
Object size
Show object size in bytes.
OpenIn sheetbashsame section
Pretty-print object
Display object content.
OpenIn sheetbashsame section
Count loose objects
Show object counts and disk usage.
OpenIn sheetbashsame section
List commits and objects
Enumerate reachable objects.
OpenIn sheetbash2 tag match