Which files should I include in .gitignore when using Git in conjunction with Xcode?
Based on this guide for Mercurial my .gitignore includes:
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
I've also chosen to include:
*.mode1v3
*.mode2v3
which, according to this Apple mailing list post, are "user-specific project settings".
Mine is a .bzrignore, but same idea :)
.DS_Store
*.mode1v3
*.pbxuser
*.perspectivev3
*.tm_build_errors
the tm_build_errors is for when I use TextMate to build my project. Not quite as comprehensive as Hagelin but I thought it was worth posting for the tm_build_errors line.
Regarding the 'build' directory exclusion -
If you place your build files in a different directory from your source, as I do, you don't have the folder in the tree to worry about.
This also makes life simpler for sharing your code, preventing bloated backups, and even when you have dependencies to other Xcode projects (while require the builds to be in the same directory as each other)
I included these suggestions in a Gist I created on Github: http://gist.github.com/137348
Feel free to fork it, and make it better.
make them Global and not at the directory level so your not pushing them to others..
Heres a script I made to auto create your .gitignore and .gitattributes files using Xcode... I hacked it together with a few other people's stuff. Have fun!
http://github.com/tbarbe/Xcode-Git-User-Script
No warranties... I suck at most of this - so use at your own peril
For Xcode 4 I also add:
YourProjectName.xcodeproj/xcuserdata/*
YourProjectName.xcodeproj/project.xcworkspace/xcuserdata/*