In brief
git ls-tree lists entries in a Git tree, such as HEAD. Recursive mode can include nested paths.
Useful to know
git ls-tree lists entries in a Git tree, such as HEAD. Recursive mode can include nested paths. [1]
This is not a list of every current local file. An untracked upload or temporary export can exist on disk without appearing in the tree. For backups, distinguish the recorded code revision from the application’s complete state.
Sources
For further detail and to check the information: