Ignoring already committed files

by Theo18. October 2011 09:24

Ever added a file to .gitignore and found that it still kept being added to the index? Well this is because git will only ignore files not currently under source control, or only files that its not already tracking.

To fix this, tell git to stop tracking the file:

git rm –cached filename

This is usable for when you discover a file thats already been commited which should be ignored.

source: stackoverflow

Comments are closed

Theo Andersen

Hi, you've reached my blog on software development.

I use this blog mostly for my own purpose of remembering stuff, so i only put things here once in a while when i get the time.

My current focus is on TDD, unit testing, object oriented code and IOS development.