Found this issue yesterday when needing to restore a versioned CoreData model from git and it didn't work. XCode only saw it as an XML file and would never allow me to change it to a CoreData Model.
It seems that when storing to Git the xcdatamodel and xcdatamodeld files are being converted to folders with xml files inside called contents.
I posted about the issue in the iOS Community on Twitter and was told that I needed to create a .gitattributes file with the line
*.xcdatamodel binary merge=union
I did that and have tried everything I can think of to get this to store the xcdatamodel correctly and nothing is changing.
I have done:
mv .git/index .git/index.bak
git reset
git status
git add .
git commit
git push
I have tried modifying the CoreData model in XCode so it notices a change and then pushing to git again, and closing XCode and deleting the xcdatamodeld pushing to git and then putting it back and pushing as if it's a new file.
No matter what I've tried I still see the xcdatamodeld as a folder with xcdatamodel folders inside it and inside them, xml contents files.
What am I doing wrong?