title: unable to remove file that really exists - fatal: pathspec ... did not match any files
body: <blockquote>
  <p>unable to remove file that really exists - fatal: pathspec ... did not match any files</p>
  </blockquote>
  <p>I have a file under git control that simply will not be deleted. The failing command is:</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ git rm .idea/workspace.xml
  fatal: pathspec '.idea/workspace.xml' did not match any files
  </code></pre>
  <p>Below I list the directory contents, branches, etc. So far I've tried rm from within the directory, and escaping just in case there are funny characters, and I'm really stumped. I searched the web and SO but couldn't find this specifically.</p>
  <pre class="lang-sh prettyprint-override"><code>$ git branch -a
  * dot-output
    master
    remotes/origin/HEAD -&gt; origin/master
    remotes/origin/master
    remotes/origin/modelspace
  $ 
  
  $ git status
  # On branch dot-output
  # Untracked files:
  # ...
  
  $ ls .idea/
  ant.xml         encodings.xml       modules.xml     workspace.xml
  compiler.xml        inspectionProfiles  scopes
  copyright       libraries       testrunner.xml
  dictionaries        misc.xml        vcs.xml
  
  $ ls -al
  total 56
  drwxr-xr-x  16 matt  staff    544 Apr 10 11:33 .
  drwxr-xr-x@ 33 matt  staff   1122 Apr 10 09:40 ..
  -rw-r--r--@  1 matt  staff  12292 Apr 10 11:19 .DS_Store
  drwxr-xr-x  18 matt  staff    612 Apr 10 11:39 .git
  -rw-r--r--   1 matt  staff     98 Mar  6 13:40 .gitignore
  drwxr-xr-x  16 matt  staff    544 Apr 10 11:34 .idea
  -rw-r--r--   1 matt  staff   1113 Feb 25 11:07 README
  ...
  
  $ head -n 2 .idea/workspace.xml
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project version=&quot;4&quot;&gt;
  
  $ git rm .idea/workspace.xml
  fatal: pathspec '.idea/workspace.xml' did not match any files
  </code></pre>
  <h3>Update</h3>
  <p>Answers from @Nevik and @Boris helped a lot. I realized that I was confused by a number of things going on, some of which were exacerbated by IntelliJ IDEA (a tool I generally love, BTW). First, the 'fatal: pathspec' message from <code>git rm</code> is both unhelpful and misleading.</p>
  <p>Second, I had the file in <code>.gitignore</code>, but had removed it before asking my question. However, it was also included in IDEA's Ignored Files feature independently of git, and showed as such in the project viewer (instead of untracked, as git status showed). Finally, I had IDEA running while I was experimenting, and it looks like it was recreating the file immediately after my <code>rm</code>.</p>
  <p>My takeaway is that if I'm getting confusing Git behavior, make sure to quit IDEA and work solely in the command line (and gitk) while debugging.</p>