But what happens when you've already submitted stuff you no longer want tracked? You can update the .gitignore file, but Git still holds on to the items you've already submitted.
Let's say you're using ReSharper (you should, it's awesome) and you've accidentally submitted the ReSharper project files into the repo.
You update your .gitignore as follows:
# Ignore ReSharper stuff
Easy. Now, to get Git to release the already tracked stuff, run this:
git rm -r --cached *_ReSharper*
And all the ReSharper associated stuff will now be flagged for removal. Commit your changes (along with the .gitignore of course) and you're done.