Skip to content

Commit 88f84a4

Browse files
committed
a few small clarifications to Objects section
1 parent 947146b commit 88f84a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

book/11-git-internals/sections/objects.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ d670460b4b4aece5915caf5c68d12f560a9fe3e4
3131
----
3232

3333
The `-w` tells `hash-object` to store the object; otherwise, the command simply tells you what the key would be.
34-
`--stdin` tells the command to read the content from stdin; if you don't specify this, `hash-object` expects the path to a file.
34+
`--stdin` tells the command to read the content from stdin; if you don't specify this, `hash-object` expects a file path at the end.
3535
The output from the command is a 40-character checksum hash.
3636
This is the SHA-1 hash – a checksum of the content you're storing plus a header, which you'll learn about in a bit.
3737
Now you can see how Git has stored your data:
@@ -121,7 +121,7 @@ The next type we'll look at is the tree, which solves the problem of storing the
121121
Git stores content in a manner similar to a UNIX filesystem, but a bit simplified.
122122
All the content is stored as tree and blob objects, with trees corresponding to UNIX directory entries and blobs corresponding more or less to inodes or file contents.
123123
A single tree object contains one or more tree entries, each of which contains a SHA-1 pointer to a blob or subtree with its associated mode, type, and filename.
124-
For example, the most recent tree in the simplegit project may look something like this:
124+
For example, the most recent tree in the a project may look something like this:
125125

126126
[source,shell]
127127
----
@@ -145,8 +145,8 @@ Conceptually, the data that Git is storing is something like this:
145145
.Simple version of the Git data model.
146146
image::images/data-model-1.png[Simple version of the Git data model.]
147147

148-
You can create your own tree.
149-
Git normally creates a tree by taking the state of your staging area or index and writing a tree object from it.
148+
You can fairly easily create your own tree.
149+
Git normally creates a tree by taking the state of your staging area or index and writing a series of tree objects from it.
150150
So, to create a tree object, you first have to set up an index by staging some files.
151151
To create an index with a single entry – the first version of your text.txt file – you can use the plumbing command `update-index`.
152152
You use this command to artificially add the earlier version of the test.txt file to a new staging area.
@@ -300,7 +300,7 @@ Date: Fri May 22 18:09:34 2009 -0700
300300
----
301301

302302
Amazing.
303-
You've just done the low-level operations to build up a Git history without using any of the front ends.
303+
You've just done the low-level operations to build up a Git history without using any of the front end commands.
304304
This is essentially what Git does when you run the `git add` and `git commit` commands – it stores blobs for the files that have changed, updates the index, writes out trees, and writes commit objects that reference the top-level trees and the commits that came immediately before them.
305305
These three main Git objects – the blob, the tree, and the commit – are initially stored as separate files in your `.git/objects` directory.
306306
Here are all the objects in the example directory now, commented with what they store:

0 commit comments

Comments
 (0)