Given object's SHA1 code, how could one identify the object type (blob, tree, tag, or commit)?
You can use git cat-file -t
, e.g.:
$ git cat-file -t ffcb14ca1dad
commit
$ git cat-file -t 74e34003a
blob
This use of git cat-file
is explained in its documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With