I made a lightweight migration that I decided I don\'t want anymore. Is there any way to just delete the file? I\'ve already changed the current model version to the one befor
Yes - having done this a lot, to my knowledge the only way is to open up YourProject.xcodeproj/project.pbxproj in your favourite raw text editor (vim ftw!), and search for and remove both instances of the offending model file. Ie:
D6A5760112F22213004DEDCE /* MyModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
D6EDB44614ED9D7E00C02938 /* MyModel-V12.xcdatamodel */,
D6931E6214D78135007F0E03 /* MyModel-V11.xcdatamodel */,
D61403DD14B7857100323E6D /* MyModel-V10.xcdatamodel */,
D675476B149BD1F3007C160C /* MyModel-V9.xcdatamodel */,
D6199DD5143DE428002869C1 /* MyModel-V8.xcdatamodel */,
);
currentVersion = D6EDB44614ED9D7E00C02938 /* MyModel-V12.xcdatamodel */;
name = MyModel.xcdatamodeld;
path = aPath/MyModel.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
So in this case, I go hunting for the two instances of D6199DD5143DE428002869C1
and delete them both from the project file, and bang: Bob's my uncle. Also - you can reorder that chunk of children above in case you want the current one higher.
After I do that, I typically execute a manual source repo delete command on just the model-V8 dir too.
This can also be done removing the .xcdatamodeld
from the project (just removing, not deleting). Then, in Finder (or Terminal) deleting the offending .xcdatamodel
file. And finally, reimporting the .xcdatamodeld
in the project.