Q:

Making Xcode 4 obey .gitignore

I've cloned a git hub repository successfully. The folder structure of that repository is as following:
root-repository-folder->iOS 
So I've moved my Xcode 4 project folder into the above folder so the folder structure looks like this then: root-repository-folder->iOS->project
I've successfully managed to commit and push my project folder to the Git Hub repository from Xcode 4 by following the guide at http://www.mindthe.net/devices/2011/04/28/12-steps-to-using-github-with-xcode-4/
So far so good, but now when I want to make another commit and push Xcode 4 tells me that I have uncommited changes referring to xcuserdata. So I add a .gitignore file to the project directory to ignore xcuserdata. But Xcode 4 doesn't seem to obey the .gitignore file. So I'm stuck here, what am I doing wrong?
Cheers,
Peter

A:

I would ask you to refer here: Git ignore file for Xcode projects
Seems to work for those using Xcode4. Make sure you have the correct entries in the .gitignore. Verify from command line once to see if the files are actually being ignored.
Also, any file that is already committed cannot be ignored. So if you had already committed it, rm it and then ignore should work.

