Ignored ≠ untracked

3.4. Ignored ≠ untracked#

Ignore rules do not affect files already tracked by Git.

git rm --cached file.txt
  • Keeps the local file; stages its removal from tracking.

  • Does not remove it from history.