3

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

Peter Warbo
  • 11,136
  • 14
  • 98
  • 193

1 Answers1

2

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.

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • Thanks I've seen that thread. And I've also used the examples from that thread in my .gitignore. How do I verify from command line? Also that file was never commited at the first push but then after I was supposed to make my second push it complained about the xcuserdata. I rm the file because Xcode 4 needs it. – Peter Warbo May 18 '11 at 21:48
  • Comment on this? `Also, any file that is already committed cannot be ignored. So if you had already committed it, rm it and then ignore should work.` – manojlds May 18 '11 at 21:49
  • 2
    I'm guessing you mean **'git rm --cached'** (or something similar) rather than **'rm'**; you may not want to lose the settings contained within the folder. – rholmes Dec 17 '11 at 00:31
  • git rm does not remove files from disk, only from the git tracking. so you can git rm -r FILE – João Nunes Sep 12 '12 at 07:39