Should XCSharedData be checked into Git Repo for Xcode project?

I just made some changes and I see a pending file that has not been added to the repo. The filenames path is */xcshareddata/IDEWorkspaceChecks.plist. Can someone explain the reason for this file and why or why not it needs to be added to the repo?


Solution 1:

The files in xcshareddata/ should be added to the repo (but not the ones in xcuserdata/):

Xcode 9.3 adds a new IDEWorkspaceChecks.plist file to a workspace's shared data, to store the state of necessary workspace checks. Committing this file to source control will prevent unnecessary rerunning of those checks for each user opening the workspace. (37293167)

https://developer.apple.com/library/archive/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html


Regarding Xcode 9 and newer, the only line you really need in your .gitignore is:

xcuserdata/

Nothing else for Xcode 9+. Whatever other lines you have in your .gitignore should be only added for your specific needs, not because you found an obsolete .gitignore sample on the internet. :)