title: Is the Git staging area just an index?
body: <p>The book Pro Git says that the staging area is just a list, or index, that says which files will be committed when a <code>git commit</code> is done, and now the name <code>index</code> is more commonly known as the "staging area".</p>
  
  <p>But if we modify the file <code>foo.txt</code> that is already part of the repo, and use <code>git add foo.txt</code> to stage it, and modify the file again, now the file is both "staged" and "modified" (as seen in <code>git status</code>), and if we commit, the "staged" version will go into the commit.  The second edit won't go in.</p>
  
  <p>So how can the "staging area" keep track of what the first edit was if it is just an index -- a list of files?</p>