Sunday, August 23, 2009

Which XCode files should be under SCM?

I am using XCode for some of my programming projects, and I would like to minimize the number of files in my SCM repository. The question is, which files are necessary for XCode to compile the project and which can be ignored?

You will of course need to add all your .h and .m files. The .xib (.nib) files should also be included. From what I have been able to figure out, you could put the following into your ignore-file (.gitignore if you are using git, as I am at the moment).

    # XCode files that can be ignored
    build/*
    *.pbxuser
    *.mode1v3

Also, it could be a good idea to add the following into your .gitattributes-file, in order to treat the project file as a binary file. This will make things easier if you get conflicts.

    *.pbxproj -crlf -diff -merge