title: Why git rm --cached not remove local ever tracked file but others
body: <p>When untrack a file in the git repository, use <code>git rm -r --cached .</code>. This will not remove the ever tracked file in local storage, but when other developers fetch this commit with <code>git pull</code>, the ever tracked file will been removed on their machine storage.</p>
  
  <p>You can reproduce it with:</p>
  
  <ol>
  <li>save current work. (<strong>Machine A</strong>)</li>
  </ol>
  
  <pre><code>git add .
  git stash save "work position"
  </code></pre>
  
  <ol start="2">
  <li>create a new file and commit it.(<strong>Machine A</strong>)</li>
  </ol>
  
  <pre><code>echo hello&gt;&gt;file_not_to_track
  git add .
  git commit -m "add file file_not_to_track"
  </code></pre>
  
  <ol start="3">
  <li>pull from another machine(or another directory)(<strong>Machine B</strong>)</li>
  </ol>
  
  <pre><code>git pull
  </code></pre>
  
  <p>show files now</p>
  
  <pre><code>ls
  file_not_to_track  README.md
  </code></pre>
  
  <ol start="4">
  <li>untrack the file.(<strong>Machine A</strong>)</li>
  </ol>
  
  <pre><code>echo file_not_to_track &gt;&gt; .gitignore
  git rm -r --cached .
  git add .
  git commit -m "untrack file_not_to_track"
  git push
  </code></pre>
  
  <p>show files now</p>
  
  <pre><code>ls
  file_not_to_track  README.md
  </code></pre>
  
  <ol start="5">
  <li>fetch code(<strong>Machine B</strong>)</li>
  </ol>
  
  <pre><code>git pull
  remote: Counting objects: 3, done.
  remote: Compressing objects: 100% (2/2), done.
  remote: Total 3 (delta 0), reused 0 (delta 0)
  Unpacking objects: 100% (3/3), done.
  From example.com:my/example_project
     6525df1..f413f8b  master     -&gt; origin/master
  Updating 6525df1..f413f8b
  Fast-forward
   .gitignore        | 1 +
   file_not_to_track | 1 -
   2 files changed, 1 insertion(+), 1 deletion(-)
   create mode 100644 .gitignore
   delete mode 100644 file_not_to_track
  </code></pre>
  
  <p>show files now</p>
  
  <pre><code>ls
  README.md
  </code></pre>
  
  <p>As it shows <code>git rm -r --cached .</code> remove ever tracked file on others repo but not in current repo.</p>