title: Remove a folder from git tracking
body: <p>I need to exclude a folder (name uploads) from tracking. I tried to run</p>
  
  <pre><code>git rm -r --cached wordpress/wp-content/uploads
  </code></pre>
  
  <p>and after that I added the path to .gitignore</p>
  
  <pre><code>/wordpress/wp-content/uploads
  </code></pre>
  
  <p>but when I ran <code>git status</code> they show up as deleted. If I try to commit the changes, the files will be deleted, not only removed from tracking.</p>
  
  <p>What am I doing wrong? </p>
  
  <p>I have also tried</p>
  
  <pre><code>git update-index --assume-unchanged &lt;file&gt;
  </code></pre>
  
  <p>but this seems to untrack only files. But I need to remove an entire folder (including subfolders) from tracking.</p>