A question that comes up frequently is what to put in your .gitignore files. I recently stumbled across a nice GitHub project which has .gitignore templates for every language it seems.
Here’s a few which are useful in my daily workflow:
iOS and Mac projects in Objective-C, using Xcode – This seems to cover both Xcode 3 and 4.
OS X (mainly for .DS_Store)
By the way, if you accidentally checked in a bunch of files you didn’t want to, use “git rm” to remove them from the repository.