Git Internals and Plumbing/Write blob object

Store file content as a blob and print its object ID.

Section: Objects and Content Plumbing

Write blob object

bash
bash
git hash-object -w path/to/file

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 from stdin
Write blob content from standard input.
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