Skip to content

How to fix git not ignoring files or folder that is just added to the .gitignore file?

Published: at 03:52 AM

If the file or folder you try to ignore is already tracked by the git, then you have to remove it from the tracking.

To remove the file from tracking, run the following command.

git rm <your-file-name-with-extension> --cached

To removed the folder from tracking, run the following command.

git rm <your-folder-name> --cached -r

Here, -r represent recursive.