Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Xcode 4 obey .gitignore

Tags:

git

github

xcode4

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

like image 832
Peter Warbo Avatar asked May 20 '26 02:05

Peter Warbo


1 Answers

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.

like image 156
manojlds Avatar answered May 22 '26 05:05

manojlds



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!