title: How can I remove 'excluded' files from a Git repository?
body: <p><strong>What I'm doing:</strong></p>
  
  <p>I'm working in Xcode, and started using Git not that long ago. </p>
  
  <p>As per normal, there are some files that I don't want to be included in the Git database, that are to do with Xcode settings. I have already been using a Git repository for a while, but now want to remove these 'editor' files as they are creating problems.</p>
  
  <hr>
  
  <p><strong>How I'm doing it:</strong></p>
  
  <p>The proper way to do this is apparently <em>not</em> to use a .gitignore. Rather, it is to use .git/info/exclude. By creating a new project in Xcode and selecting the "use Git" option, I was able to find out that the default setting for this should be a .git/info/exclude file of the following:</p>
  
  <blockquote>
    <p>.DS_Store </p>
    
    <p>UserInterface.xcuserstate</p>
  </blockquote>
  
  <p>So I copied this exclude file over to the same git location for the project I'm working on, and it seems to be ok. Except...</p>
  
  <hr>
  
  <p><strong>What goes wrong:</strong></p>
  
  <p>The files of course will not be removed/untracked from my current project without manual intervention. So, I've tried the following, which <strong>doesn't</strong> work and tells me there are no such files:</p>
  
  <pre><code>git rm --cached .DS_Store
  git rm --cached UserInterface.xcuserstate
  </code></pre>
  
  <p>But these files are definitely there, and if I go to commit my repo branch then all sorts of user interface files want to join the party too. </p>
  
  <hr>
  
  <p><strong>The Question:</strong></p>
  
  <p>So, what is the 'exclude' file actually doing? Is there a way to make the exclude file untrack  or apply itself to all repo branches easily?</p>
  
  <p>If not, how can I get my project into the same state that it would be had I created the git repo from Xcode at square one?</p>