title: .gitignore not working even when I clear the cache
body: <p>I made the mistake of creating a gitignore file after I had already pushed an initial commit to my git repo.</p>
  
  <p>My .gitignore is very simple, it only contains:</p>
  
  <pre><code>node_modules
  </code></pre>
  
  <p>I've tried the following:</p>
  
  <pre><code>git rm --cached -rf .
  git add .
  git commit 'Fix untracked files'
  git push
  </code></pre>
  
  <p>I've also tried deleting my <code>.git</code> folder in my project directory and reinitializing the entire project. </p>
  
  <p>Both times it still pushes my <code>node_modules</code> directory!</p>
  
  <p>How do I fix this?</p>