title: git rm --cached is removing files from file system
body: <p>I've started working on a project and I've added <code>.idea/*</code> to the <em>.gitignore</em> file, but it still show's up.</p>
  
  <p>So I thought the file must be in the git cache so I ran <code>git rm --cached filename</code>, although it does not seems to work as it actually removes the file when I merge the branch, you can see my git commands below.</p>
  
  <p>I recently started developing on a macbook pro, before I was working on ubuntu and I never had this issue.  Perhaps it has something to do with my <code>git</code> setup.</p>
  
  <p>This has happened before on another project, that time when I ran <code>git rm --cached .</code> it actually removed most of the project files from the file system.</p>
  
  <pre><code>$ (786-rwd) git status
  On branch 786-rwd
  Your branch is up-to-date with 'origin/786-rwd'.
  Changes to be committed:
    (use "git reset HEAD &lt;file&gt;..." to unstage)
  
      deleted:    .idea/misc.xml
  
  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:   .gitignore
      modified:   .idea/modules.xml
      modified:   .idea/www.project.dev.iml
      modified:   app/design/frontend/bootstrapped/rwd/template/prog/bund.phtml
  
  Untracked files:
    (use "git add &lt;file&gt;..." to include in what will be committed)
  
      skin/frontend/bootstrapped/rwd/sass/_cms-pages.scss
  
  holy in ~/ubuntu_1404/httpdocs/porject
  $ (786-rwd) git rm --cached .idea/modules.xml
  rm '.idea/modules.xml'
  holy in ~/ubuntu_1404/httpdocs/porject
  $ (786-rwd) git rm --cached .idea/www.project.dev.iml
  rm '.idea/www.project.dev.iml'
  
  $ (786-rwd) git status
  On branch 786-rwd
  Your branch is up-to-date with 'origin/786-rwd'.
  Changes to be committed:
    (use "git reset HEAD &lt;file&gt;..." to unstage)
  
      deleted:    .idea/misc.xml
      deleted:    .idea/modules.xml
      deleted:    .idea/www.project.dev.iml
  
  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:   app/design/frontend/bootstrapped/rwd/template/prog/bund.phtml
  
  Untracked files:
    (use "git add &lt;file&gt;..." to include in what will be committed)
  
      skin/frontend/bootstrapped/rwd/sass/_cms-pages.scss
  
  holy in ~/ubuntu_1404/httpdocs/porject
  $ (786-rwd) ls .idea/
  ./                       .name                    deployment.xml           encodings.xml            scopes/                  workspace.xml
  ../                      copyright/               dictionaries/            modules.xml              vcs.xml                  www.project.dev.iml
  
  $ (786-rwd) git add .
  holy in ~/ubuntu_1404/httpdocs/project
  $ (786-rwd) git commit -m 'theming &amp; cleaned up git'
  [786-rwd 8aa5ba8] theming &amp; cleaned up git
   5 files changed, 24 deletions(-)
   delete mode 100644 .idea/misc.xml
   delete mode 100644 .idea/modules.xml
   delete mode 100644 .idea/www.project.dev.iml
   create mode 100644 skin/frontend/bootstrapped/rwd/sass/_cms-pages.scss
  holy in ~/ubuntu_1404/httpdocs/project
  $ (786-rwd) git status
  On branch 786-rwd
  Your branch is ahead of 'origin/786-rwd' by 1 commit.
    (use "git push" to publish your local commits)
  nothing to commit, working directory clean
  holy in ~/ubuntu_1404/httpdocs/project
  $ (786-rwd) git checkout -b test-branch origin/prod
  Branch test-branch set up to track remote branch prod from origin.
  Switched to a new branch 'test-branch'
  holy in ~/ubuntu_1404/httpdocs/project
  $ (test-branch) git merge --no-ff 786-rwd 
  Auto-merging app/design/frontend/bootstrapped/mobile/template/program/results.phtml
  Auto-merging app/design/frontend/bootstrapped/default/template/page/html/header.phtml
  Removing .idea/www.project.dev.iml
  Removing .idea/modules.xml
  Removing .idea/misc.xml
  Merge made by the 'recursive' strategy.
   .gitignore                                                                         |    6 +-
   .idea/misc.xml                                                                     |    5 -
   .idea/modules.xml                                                                  |    9 -
   .idea/www.project.dev.iml                                                      |    9 -
   app/design/frontend/bootstrapped/default/layout/local.xml                          |   66 ++++
  
  
  $ (test-branch) ls .idea/
  ./              ../             .name           copyright/      deployment.xml  dictionaries/   encodings.xml   scopes/         vcs.xml         workspace.xml
  </code></pre>