Make Git ignore a tracked file (Previously Committed)

Posted 9 months ago

If a file has previously been committed and you want said file to be ‘ignored’ just adding the file into .gitignore isn’t enough, you have to explicitly tell Git to remove the file.

If you run `git status` on the file that has been committed in the past but is now in the .gitignore, it will continue to appear.

To stop tracking a file you need to remove it with


git rm --cached