R's Workshop

Git Tag a Blob Object

前幾天在這篇文章中看到 git 可以 tag blob/tree objects. 紀錄一下要如何 tag 一個 blob object.

Get Blob Object SHA1

Tag a Blob Object

annotated

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^{}

Reference

Git