4 All the information tracked by git is stored and organized in the form
7 Objects are stored in the object store, which is literally just a
8 content-addressable collection of objects. All objects are named by their
9 content, which is approximated by the SHA1 hash of the object itself.
11 Git recognizes the following objects types:
15 Pure storage object, contains user data. Cannot refer to any other
18 Is created with git-update-index (or git-add) and its contents can be
19 accessed with git-cat-file.
23 Ties one or more objects into a directory structure. Can refer to other
24 tree objects, thus creating a directory hierarchy.
26 Is a list of mode/name/blob data, sorted by name. The mode data may
27 specify a directory mode, in which case instead of naming a blob, that name
28 is associated with another tree object.
30 A tree is created with git-write-tree, its data can be accessed with
31 git-ls-tree an two trees can be compared with git-diff-tree.
35 Ties such directory hierarchy together into a DAG of revisions.
37 Each commit is associated exactly with one tree (the directory hierarchy
38 at the time of the commit). In addition, a commit refers to one or more
39 parent commit objects that describe the history of how we arrived at that
42 The root commit is the first commit of a project.
44 The SHA1 signature of a commit refers to the SHA1 signatures of the tree
45 it is associated with and the signatures of the parent, a single named
46 commit specifies uniquely a whole set of history, with full contents.
47 You can't later fake any step of the way once you have the name of a commit.
49 A commit is created with git-commit-tree and its data can be accessed
54 Symbolically identifies and can be used to sign other objects.
56 The following picture shows the relationship between objects:
60 commit <------- commit <------- commit <------- ....
70 tree tree complex hierarchy)
79 Stores the current working tree state. It's used to checkout files and
80 make comparisons efficiently.
85 o working directory -> index
87 The index can be updated with the information from the working
88 directory with the git-update-index program.
90 o index -> object database
92 You write your current index file to a tree object with the
93 git-write-tree program.
95 It returns the name of the resulting top-level tree.
97 o object database -> index
99 You read a tree file from the object database, and use that to
100 populate the current index with git-read-tree program.
102 o index -> working directory
104 To check out files from the index use the git-checkout-index program.