I am a git novice trying to sort through the concepts and terms. The git glossary says a tree is equivalent to a directory and a directory is what you get with ls. Are they interchangeable terms? Or are "tree" and "directory" to be used in different contexts or to refer to separate (though related) things?
Structure. The directory is structured in the form of a tree. It also has a root directory, and every file in the system has a unique path. A directory within a tree-structured directory may contain files or subdirectories.
There is a subtle difference in meaning. A directory is a singular thing -- a folder, a collection of files -- whereas a working tree means a tree like structure of files and directories that are collectively referenced.
A directory tree is a hierarchy of directories that consists of a single directory, called the parent directory or top level directory, and all levels of its subdirectories (i.e., directories within it).
A directory structure/system/tree is simply a layout of directories on your computer. Taking a big step back, the early computer designers realized that lumping together every single file on your computer would create a massive jumble and make it impossible to find anything. So they wisely created the directory.
The short answer: yes, a tree is a directory and a directory is a tree.
The long answer: A tree is an object that contains a list of blobs, the names to attach to the blobs, and other trees and the names to attach to them. http://book.git-scm.com/1_the_git_object_model.html has a pretty good explanation of the different object types in the git model; I would suggest reading it!
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