前幾天在這篇文章中看到 git 可以 tag blob/tree objects. 紀錄一下要如何 tag 一個 blob object.
git rev-parse COMMIT_ISH:PATH/TO/FILE
git hash-object -w PATH/TO/FILE
cat PATH/TO/FILE | git hash-object -w --stdin
echo 'blob content' | git hash-object -w --stdin
git tag TAG_NAME BLOB_SHA1
git tag -a TAG_NAME BLOB_SHA1
# Retrieve Tag Content
* Such a tag cannot be checkout, since it refers to a blob object rather than a commit.
To get the blob content
```shell
git cat-file -p TAG_NAME^{}
Git
Written on
October
19th,
2022
by
Borting