From 09d59d12d1e953d9bfbe92ddec9318889841adda Mon Sep 17 00:00:00 2001 From: Ben Lynn Date: Fri, 26 Mar 2010 01:21:10 -0700 Subject: [PATCH] Expanded index explanation. --- en/secrets.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/en/secrets.txt b/en/secrets.txt index 264f805..7928b0c 100644 --- a/en/secrets.txt +++ b/en/secrets.txt @@ -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. -- 2.11.4.GIT