Stop tracking a file in Git

24 Apr 2026 • 1 min read

How to stop tracking changes in a file in Git

How to stop tracking changes in a file in Git

To stop tracking a file, it has to be removed from the index:

BASH
git rm --cached <file>

To remove a folder and all files in the folder recursively:

BASH
git rm -r --cached <folder>

The removal of the file from the head revision will happen on the next commit.

Start searching

Enter keywords to search articles.