Skip to content

Commit

Permalink
Expanded index explanation.
Browse files Browse the repository at this point in the history
  • Loading branch information
blynn committed Mar 26, 2010
1 parent 839f7e0 commit 09d59d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion en/secrets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ Git heuristically ferrets out renames and copies between successive versions. In

=== Indexing ===

For every tracked file, Git records information such as its size, creation time and last modification time in a file known as the 'index'. To determine whether a file has changed, Git compares its current stats with that held in the index. If they match, then Git can skip reading the file again.
For every tracked file, Git records information such as its size, creation time and last modification time in a file known as the 'index'. To determine whether a file has changed, Git compares its current stats with those cached in the index. If they match, then Git can skip reading the file again.

Since stat calls are considerably faster than file reads, if you only edit a
few files, Git can update its state in almost no time.

We stated earlier that the index is a staging area. Then how can the index
just be a bunch of file stats?

The index can be thought of as a staging area because the add command puts
files into Git's database and updates the index accordingly, while the commit
command, without options, creates a commit based on the state of the index.

=== Bare Repositories ===

You may have been wondering what format those online Git repositories use.
Expand Down

0 comments on commit 09d59d1

Please sign in to comment.