Is it safe to ignore / xcuserdata / with Git when using start arguments?

I have an argument passed at startup: -D DEBUG , which allows me to use the following in my release:

 #ifndef DEBUG /* Some code I only want to be run when using the release app */ #endif 

When I run git status , it shows me that the file changed when adding -D DEBUG is MyExampleProject.xcodeproj/xcuserdata/myusername.xcuserdatad/xcschemes/MyExampleProject.xcscheme

Which should be excluded using the commonly used Xcode .gitignore file. Is there any other way to include this argument that matches .gitignore and is independent of my xcuserdata user xcuserdata ?

+45
git xcode
Dec 19
source share
2 answers

Generally, xcuserdata is safe to ignore for individual projects. Each user gets his own file, which saves the user state, open folders, the last file is open, something like this. It contains your circuits. If this is the first time and the file does not exist, Xcode will create it for you.

However ... we encountered this problem in the office when you have a continuous build server, such as Hudson or Jenkins, which copies the source from Git or SVN without opening it and does not try to create it. If you ignore this file, there will be no schemes to create, or it will force someone to open the project in order to automatically create it for the first time.

We solved this by checking the shared field within the control schemes. This moves the schemas from under your individual xcuserdata to a shared folder that can be transferred through the source control and used by continuous build servers. Hope this helps.

+79
Dec 19 '12 at 14:42
source share

This folder contains some temporary information. Like the Xcode user state and similar properties. We recommend that GitHub exclude the xcuserdata folder in the xcuserdata file.

+12
Dec 19
source share



All Articles