title: Where is the git index?
body: <p>In Git the staging area is also referred to as the index.  What seems to be said is that when you make changes in your working directory and add these changes to 'staging' git adds these files to an index file.  When opening a projects /.git/index file, I see a file that contains text that displays when I type:</p>
  
  <pre><code>git status
  </code></pre>
  
  <p>I may get output that looks like this:</p>
  
  <pre><code># On branch master
  # Changes not staged for commit:
  #   (use "git add &lt;file&gt;..." to update what will be committed)
  #   (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  #
  #       modified:   Gemfile
  #
  no changes added to commit (use "git add" and/or "git commit -a")
  </code></pre>
  
  <p>But in other places like <a href="https://stackoverflow.com/questions/4084921/what-does-the-git-index-exactly-contains" title="Git Index Contents">Git Index Contents</a> they say that by typing: </p>
  
  <pre><code>git ls-files --stage
  </code></pre>
  
  <p>You can see the contents of the index.. though this is clearly not what is in /.git/index.  What file in the .git directory actually houses this index?  What I suspect, and I may be wrong.. is that .git/index is storing the change information in the 'modified' line and then when typing git ls-files --stage that it is building up a a list of the files that are staged and their hashes based on the files in the working directory and those that are listed as modified in this index file.. Is this correct?</p>