Last Updated: September 29, 2021
·
424
· aymanfarhat

Ignore previously tracked files in Git

.gitignore prevents untracked files from being added to the set of files tracked by git, however git will continue to track any files that are already being tracked.

To stop tracking a file you need to remove it from the index. This can be done via:

git rm --cached <file>