Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the xcschememanagement.plist file do in XCode? And can I ignore it with git?

Due to the poor documentation of XCodes files that manage your project under the hood, I cannot understand the purpose of the xcschememanagement.plist file, which is causing me a lot of problems.

Can anyone explain this file's purpose, and how we should be treating it with git source control?

Here is the full path to the file PROJECT_ROOT/xcuserdata/alecmather.xcuserdatad/xcschemes/xcschememanagement.plist

My problem with git and this file: Let's say I start on branch_1. I make some commits to this branch. Then I switch to branch_2. I make some commits there, and decide to run my project. After I'm done, I stop running my project and switch back to branch_1. I run my project there, and close it. I attempt to switch back to branch_2 but am stopped by git saying that I have uncommitted changes in the current directory. But I did nothing but run my project.

So I'm assuming that this file holds some things that can get changed around when building/running your project? But this gets really tedious when switching between branches all the time. Do I commit the changes to that file from this scenario? Can I safely just discard the changes?

like image 718
Alec Mather Avatar asked May 27 '20 17:05

Alec Mather


People also ask

How do I ignore files in Xcode git?

Go to gitignore.io, enter Xcode in the search field, and click the Create button. You will get a git ignore file with a list of file types that git should ignore. Add the git ignore file to your project folder.


1 Answers

Yes, you can safely ignore the whole xcuserdata folder. All premade .gitignore files I've seen so far for Xcode projects do so, including https://github.com/github/gitignore/blob/master/Global/Xcode.gitignore

like image 178
Gereon Avatar answered Oct 01 '22 08:10

Gereon