A tree-ish is a directory that contains files and subdirectories. In other words, a tree-ish can be a directory, a commit or a reference. For example:
- SHA-1 hash
- Example:
git show <SHA>
- Example:
- HEAD
- Example:
git show HEAD
- Example:
- Branch
- Tag
- Ancestry
- Example:
git show HEAD^
- Example:
List a tree-ish object
We can list a tree-ish object using the ls-tree
command. For example:
git ls-tree HEAD
100644 blob 69caab2831763a8daca09ab0e09af36051308e98 README.md
100644 blob 148a5d09ed23ad803c5ba56df6d16c173a09a79d myfile.txt