in a XCode project, I offen got xcodeproject/project.pbxproj file changed, but useless info for me, it for compile.
Should I git ignore this file and xcodeproject/projectxworkspace/username.xcuserdata/UserInterfaceState.xcuserstate file?
This file holds the list of all the files in the project, settings of targets and which files belong to which targets. It’s probably the meatiest file in project bundle. You should not ignore this file. There are few points for this:
- You may not want to work on this project alone or;
- You’re planning on working on project from different machines;
- You’ll want to share your code base with others;
That is the only file that you want in your repos from the xcodeproj bundle. That file holds all of the info for targets files and build settings.
Unfortunately, if your Build Settings includes code signing, you have to re-enter your code-signing entity after every “git pull” if another team member has changed it. It seems to me this info should be in the user settings, not the global pbxproj file.
If you exclude project.pbxproj Jenkins builds will fail. So this is important if you use Jenkins.
I found that I also need to preserve the xcworkspace file(s). If didn’t, project with a sub-project broke.