title: git is ignoring files that aren't in .gitignore?
body: <p>Solved:  Decided to delete the .git directory and try again, since there was nothing in it anyway.  <em>rm -rf .git</em>, then <em>git init</em>, then <em>git add .</em>.  Now it's working, everything is getting added correctly, and things that should be ignored are.  Think I mis-cloned 960gs or html5boilerplate into the project directory instead of a subdirectory.  Thanks everyone for your replies, much appreciated.</p>
  
  <hr>
  
  <p>There are lots of questions on SO about git failing to ignore files specified in .gitignore.  My problem is the exact opposite - git is ignoring files that <em>aren't</em> listed in .gitignore.</p>
  
  <p>For example, I've just started a web project using <a href="http://html5boilerplate.com/" rel="nofollow">HTML5Boilerplate</a> and <a href="http://960.gs/" rel="nofollow">960 Grid System</a>, and am trying to do the initial commit.  However, only a few of the files and directories I need are being staged when I run 'git add *'.  </p>
  
  <p>.gitignore in the project directory specifies a list of project, vcs, and other files to ignore, but not *.html, *.xml, *.conf, .htaccess, *.ico, *.png files, which are not being staged to the index.  Strangely, one html file is being added, demo.html, while index.html isn't.</p>
  
  <p>Anyone have any idea what's wrong and how to fix it?</p>
  
  <p>Here's a transcript of the operations for clarity:</p>
  
  <pre><code>%&gt; ls -al
  total 136
  drwxr-xr-x 13 me me  4096 2010-11-08 14:04 .
  drwxr-xr-x  6 me me  4096 2010-11-08 13:23 ..
  -rw-r--r--  1 me me   720 2010-11-08 13:21 404.html
  -rw-r--r--  1 me me  1893 2010-11-08 13:21 apple-touch-icon.png
  drwxr-xr-x  3 me me  4096 2010-11-08 13:21 build
  -rw-r--r--  1 me me   802 2010-11-08 13:21 crossdomain.xml
  drwxr-xr-x  3 me me  4096 2010-11-08 13:24 css
  drwxr-xr-x  2 me me  4096 2010-11-08 13:21 demo
  -rwxr-xr-x  1 me me  8920 2010-11-08 13:15 demo.html
  -rw-r--r--  1 me me  1150 2010-11-08 13:21 favicon.ico
  drwxr-xr-x  8 me me  4096 2010-11-08 14:04 .git
  -rw-r--r--  1 me me   266 2010-11-08 13:44 .gitignore
  -rw-r--r--  1 me me  8011 2010-11-08 13:21 .htaccess
  drwxr-xr-x  2 me me  4096 2010-11-08 13:21 images
  drwxr-xr-x  2 me me  4096 2010-11-08 13:15 img
  -rw-r--r--  1 me me  3115 2010-11-08 13:21 index.html
  drwxr-xr-x  5 me me  4096 2010-11-08 13:21 js
  -rw-r--r--  1 me me  5166 2010-11-08 13:21 lighttpd.conf
  -rw-r--r--  1 me me  3484 2010-11-08 13:21 mime.types
  -rw-r--r--  1 me me  3413 2010-11-08 13:21 nginx.conf
  -rw-r--r--  1 me me     0 2010-11-08 14:04 output.txt
  -rw-r--r--  1 me me  6277 2010-11-08 13:21 README.markdown
  -rw-r--r--  1 me me   107 2010-11-08 13:21 robots.txt
  drwxr-xr-x  4 me me  4096 2010-11-08 13:17 templates
  drwxr-xr-x  3 me me  4096 2010-11-08 13:21 test
  drwxr-xr-x  2 me me  4096 2010-11-08 13:45 vim~
  -rw-r--r--  1 me me 12274 2010-11-08 13:21 web.config
  drwxr-xr-x  2 me me  4096 2010-11-08 12:09 wireframes
  
  %&gt; less .gitignore
  # Numerous always-ignore extensions
  *.diff
  *.err
  *.orig
  *.log
  *.rej
  *.swo
  *.swp
  *.vi
  *~
  
  # OS or Editor folders
  .DS_Store
  .cache
  .project
  .settings
  nbproject
  thumb.db
  
  # Folders to ignore
  .hg
  .svn
  publish
  .idea
  templates
  template
  
  # files
  build/buildinfo.properties
  
  %&gt; git add *
  # Not currently on any branch.
  # Changes to be committed:
  #   (use "git reset HEAD &lt;file&gt;..." to unstage)
  #
  #   new file:   css/960.css
  #   new file:   css/960_24_col.css
  #   new file:   css/reset.css
  #   new file:   css/rtl_960.css
  #   new file:   css/rtl_960_24_col.css
  #   new file:   css/rtl_text.css
  #   new file:   css/text.css
  #   new file:   css/uncompressed/960.css
  #   new file:   css/uncompressed/960_24_col.css
  #   new file:   css/uncompressed/demo.css
  #   new file:   css/uncompressed/reset.css
  #   new file:   css/uncompressed/rtl_960.css
  #   new file:   css/uncompressed/rtl_960_24_col.css
  #   new file:   css/uncompressed/rtl_text.css
  #   new file:   css/uncompressed/text.css
  #   new file:   demo.html
  #   new file:   img/12_col.gif
  #   new file:   img/16_col.gif
  #   new file:   img/24_col.gif
  #   new file:   wireframes/basalmiq01.pdf
  #   new file:   wireframes/basalmiq01.png
  #   new file:   wireframes/basalmiq01.xml
  #   new file:   wireframes/fcf_mockingbird.zip
  #   new file:   wireframes/fcf_mockingbird_.zip
  #
  # Changed but not updated:
  #   (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:   .gitignore
  #
  # Untracked files:
  #   (use "git add &lt;file&gt;..." to include in what will be committed)
  #
  #   output.txt
  </code></pre>