This is an old revision of the document!


How to write an arbitrary blob to a repository to add “supplemental” information.

Feed arbitrary text into git hash-object, and write the corresponding blob to the object store:

echo "Robert P. J. Day" | git hash-object -w --stdin
8a1385ff5d6ab8c195f99931042b7afaf418e6b0
$
$ git show 8a1385ff5d6ab8c195f99931042b7afaf418e6b0
Robert P. J. Day
$

In order for that blob not to be garbage-collected, tag it:

$ git tag fullname 8a1385ff5d6ab8c195f99931042b7afaf418e6b0

Show it:

$ git show fullname
Robert P. J. Day
$
  • git_writing_an_arbitrary_blob.1551187148.txt.gz
  • Last modified: 2019/02/26 13:19
  • by rpjday