How to untrack files in Git

We all know how to add a file under Git tracking.

But what can we do to untrack a file or directory?

To untrack a file:

git rm --cached filename

To untrack a directory (recursively)

git rm -r --cached dir_name

If you develop with Intelij tools you can use the nice and helpful .ignore plugin

This entry was posted in Software Engineering. Bookmark the permalink.