A commit object is an object that refers to a tree and associates other metadata with it (author, committer, timestamps, etc.).
Commit / \ / \ (parent SHA) Tree (author) / \ (committer) Blob Blob (timestamps) (etc)
Several commit objects can refer to the same tree (if the state of the files in each commit is identical).
For example, if two people make the same change in a file and commit, this will result in two different commit objects (since both timestamps and authors will be different). However, since the end result is the same file content, both commits point to the same tree.
When you execute git ls-tree on a SHA commit, it automatically uses the SHA of the tree referenced by that commit.
source share