← TechnologyThe essentials of

Git rm --cached: untracking without deleting the working file

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 16:11 · Updated: 22 Oct 2026 16:11

AI source check: 22 Oct 2026 14:04. This is not editorial approval.

In a few sentences

In brief

git rm --cached removes a selected file from the index while leaving its working copy on disk. A commit is needed to record that change in history.

Useful to know

git rm --cached removes a selected file from the index while leaving its working copy on disk. A commit is needed to record that change in history. [1]

It does not erase older versions of the file. If they contain a secret, untracking does not invalidate it. Add an appropriate ignore rule and separately address any data already exposed.

Sources

For further detail and to check the information:

  1. [1] Git - git-rm Documentation ↗