title: Quickly remove all files from a git repository
body: <p>In a repository I have there are lots of unnecessary files, which I would like to remove from the repo and only keep locally. I understand that this is done by:</p>
  
  <pre><code>git rm --cached a_file
  </code></pre>
  
  <p>... or with <code>-r</code> in case it's a folder.</p>
  
  <p>Now, it's easier to remove everything and add the few files I need.
  If I use <code>*</code>, git rightly complains when it's given files that are not in the repo, but in the same local folder.</p>
  
  <p>How should I proceed?</p>
  
  <p>EDIT:
  Using the <code>-f</code> flag won't work either:</p>
  
  <pre><code>$ git rm --cached -fr *
  fatal: pathspec 'somefile' did not match any files
  </code></pre>