Skip to content

Commit

Permalink
further revision of the beginning chapters, updated all the images wi…
Browse files Browse the repository at this point in the history
…th new object representations
  • Loading branch information
schacon committed Jul 30, 2008
1 parent 4d692e1 commit 3f8e587
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
Binary file added assets/images/figure/object-blob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/figure/object-commit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/figure/object-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/figure/object-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/figure/objects-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions text/02_Git_Object_Db_Basics/0_ Git_Object_Db_Basics.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ others:

### The Objects ###

<div class="center span-21">
<img width="350" src="images/figure/object_types.png">
</div>

There are four different types of objects: "blob", "tree", "commit", and
"tag".
Every object consists of three things - a **type**, a **size** and **content**.
The _size_ is simply the size of the contents, the contents depend on what
type of object it is, and there are four different types of objects:
"blob", "tree", "commit", and "tag".

- A **"blob"** is used to store file data - it is generally a file.
- A **"tree"** is basically like a directory - it references a bunch of
Expand Down
6 changes: 5 additions & 1 deletion text/02_Git_Object_Db_Basics/1_Trees_and_Blobs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

A blob generally stores the contents of a file.

[fig:object-blob]

You can use linkgit:git-show[1] to examine the contents of any blob.
Assuming we have a SHA for a blob, we can examine its contents like this:

Expand All @@ -24,7 +26,9 @@ renaming a file does not change the object that file is associated with.
### Tree Object ###

A tree is a simple object that has a bunch of pointers to blobs and other
trees.
trees - it generally represents the contents of a directory or subdirectory.

[fig:object-tree]

The ever-versatile linkgit:git-show[1] command can also be used to
examine tree objects, but linkgit:git-ls-tree[1] will give you more
Expand Down
10 changes: 6 additions & 4 deletions text/02_Git_Object_Db_Basics/2_Commits.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
### Commit Object ###

The "commit" object links a physical state of a tree with a description
of how we got there and why. Use the --pretty=raw option to
of how we got there and why.

[fig:object-commit]

You can use the --pretty=raw option to
linkgit:git-show[1] or linkgit:git-log[1] to examine your favorite
commit:

Expand Down Expand Up @@ -66,9 +70,7 @@ If we had a simple project with the following directory structure:

And we committed this to a Git repository, it would be represented like this:

<div class="span-21 center">
<img src="images/figure/model-real.png">
</div>
[fig:objects-example]

You can see that we have created a **tree** object for each directory (including the root)
and a **blob** object for each file. Then we have a **commit** object to point
Expand Down
3 changes: 2 additions & 1 deletion text/02_Git_Object_Db_Basics/3_Trust_and_Tags.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@


### Tag Object ###

[fig:object-tag]

A tag object contains an object, object type, tag name, the name of the
person ("tagger") who created the tag, and a message, which may contain
a signature, as can be seen using linkgit:git-cat-file[1]:
Expand Down

0 comments on commit 3f8e587

Please sign in to comment.