Monday, December 3, 2012

Ignoring a file that is already added to git

To ignore a file that was already added to git, you need to tell git to assume the file is unchanged and add it to .gitignore like normal.

So first, add the file to your .gitignore file.

Then use the following command to tell git to assume it's unchanged:


git update-index --assume-unchanged YourFile


source:  http://jameschambers.com/blog/ignoring-a-file-that-you-have-already-started-tracking-in-git

No comments:

Post a Comment